<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Viv posts</title>
  <subtitle>Computational demos that run in your browser and check themselves</subtitle>
  <link href="https://viv-lang.org/posts"/>
  <link rel="self" href="https://viv-lang.org/feed.xml"/>
  <id>https://viv-lang.org/feed</id>
  <updated>2026-10-14T12:00:00Z</updated>
  <author><name>Adam Zettel</name><uri>https://notesoncomputing.com</uri></author>
  <entry>
    <title>Finite differences and spectral methods</title>
    <link href="https://viv-lang.org/p/finite-differences-and-spectral-methods"/>
    <id>https://viv-lang.org/p/finite-differences-and-spectral-methods</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>Two ways to differentiate a function you only know at grid points. A central difference uses the two neighbors; a spectral derivative uses every point. On a smooth periodic function the spectral one reaches rounding error with a few dozen points. Put a jump in the function and, away from the jump, the central difference is the accurate one.</summary>
    <category term="numerics"/>
    <category term="fourier"/>
    <category term="derivatives"/>
  </entry>
  <entry>
    <title>LQR stabilizes the cart-pole at half the gain</title>
    <link href="https://viv-lang.org/p/lqr-gain-margin"/>
    <id>https://viv-lang.org/p/lqr-gain-margin</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>Stable for every gain scaling from 1/2 to 1000; stability is lost only below 0.463.</summary>
    <category term="control"/>
    <category term="LQR"/>
  </entry>
  <entry>
    <title>Each digit of Monte Carlo accuracy costs 100× the paths</title>
    <link href="https://viv-lang.org/p/monte-carlo-rate"/>
    <id>https://viv-lang.org/p/monte-carlo-rate</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>The error falls like N^(-1/2), with a log-log slope between -0.6 and -0.4 from 1,000 to 1,000,000 paths.</summary>
    <category term="finance"/>
    <category term="option pricing"/>
  </entry>
  <entry>
    <title>Put-call parity holds to rounding error</title>
    <link href="https://viv-lang.org/p/put-call-parity"/>
    <id>https://viv-lang.org/p/put-call-parity</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>Over 3,000 quotes parity holds to 10^-15 of the spot, and early exercise of an American call never pays.</summary>
    <category term="finance"/>
    <category term="option pricing"/>
  </entry>
  <entry>
    <title>Ripple-carry delay grows like n, carry-lookahead like log n</title>
    <link href="https://viv-lang.org/p/adder-depth"/>
    <id>https://viv-lang.org/p/adder-depth</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>At 64 bits the critical path is 132 gate delays for ripple carry and 13 for Kogge-Stone, which uses about twice the gates.</summary>
    <category term="hardware"/>
    <category term="arithmetic circuits"/>
  </entry>
  <entry>
    <title>Finite differences stay second order away from a jump</title>
    <link href="https://viv-lang.org/p/central-difference-near-a-jump"/>
    <id>https://viv-lang.org/p/central-difference-near-a-jump</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>Away from the jumps the central difference error falls by 3.9 to 4.1 per doubling of N; the spectral error stays above 0.7.</summary>
    <category term="math"/>
    <category term="approximation"/>
  </entry>
  <entry>
    <title>Conjugate gradients take √κ iterations</title>
    <link href="https://viv-lang.org/p/cg-sqrt-kappa"/>
    <id>https://viv-lang.org/p/cg-sqrt-kappa</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>Iterations grow like sqrt(κ) (slope 1.05); bad scaling stalls CG past 10,000 iterations, and Jacobi brings it back to 2 times the unscaled count.</summary>
    <category term="math"/>
    <category term="linear algebra"/>
  </entry>
  <entry>
    <title>The Taylor series of eˣ fails at x = −20</title>
    <link href="https://viv-lang.org/p/exp-series-cancellation"/>
    <id>https://viv-lang.org/p/exp-series-cancellation</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>Terms reach 4.3 × 10^7 for an answer of 2.1 × 10^-9, so the sum is off by more than 10%; 1/e^20 is good to 10^-14.</summary>
    <category term="math"/>
    <category term="floating point"/>
  </entry>
  <entry>
    <title>The best forward-difference step is about 10⁻⁸</title>
    <link href="https://viv-lang.org/p/finite-difference-step"/>
    <id>https://viv-lang.org/p/finite-difference-step</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>The forward difference is best near h = 10^-8, with error between 10^-9 and 10^-7; at h = 10^-12 rounding pushes both errors above 10^-6.</summary>
    <category term="math"/>
    <category term="floating point"/>
  </entry>
  <entry>
    <title>Givens QR of a Hessenberg matrix costs O(n²)</title>
    <link href="https://viv-lang.org/p/givens-hessenberg"/>
    <id>https://viv-lang.org/p/givens-hessenberg</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>About 3n^2 operations against Householder's 4/3n^3; at n = 400 Householder does more than 100 times the work.</summary>
    <category term="math"/>
    <category term="linalg"/>
  </entry>
  <entry>
    <title>Each factor of ten in the condition number costs a digit</title>
    <link href="https://viv-lang.org/p/hilbert-digits"/>
    <id>https://viv-lang.org/p/hilbert-digits</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>Correct digits stay within 1 below and 3 above 16 - log_10κ; at n = 12 fewer than 3 remain.</summary>
    <category term="math"/>
    <category term="linear algebra"/>
  </entry>
  <entry>
    <title>Leapfrog holds a planet's energy for 100,000 orbits</title>
    <link href="https://viv-lang.org/p/kepler-leapfrog-rk4"/>
    <id>https://viv-lang.org/p/kepler-leapfrog-rk4</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>Leapfrog's energy error is the same after 100,000 periods as after 10,000, while RK4's grows 10 times.</summary>
    <category term="math"/>
    <category term="differential equations"/>
  </entry>
  <entry>
    <title>Newton's method doubles the correct digits each step</title>
    <link href="https://viv-lang.org/p/newton-quadratic"/>
    <id>https://viv-lang.org/p/newton-quadratic</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>Full double precision for sqrt(2) in 5 steps, where bisection needs 52; the error ratio e_(k+1)/e_k^2 is near 0.354.</summary>
    <category term="math"/>
    <category term="root finding"/>
  </entry>
  <entry>
    <title>1 − cos x loses its digits as x shrinks</title>
    <link href="https://viv-lang.org/p/one-minus-cos"/>
    <id>https://viv-lang.org/p/one-minus-cos</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>At x = 10^-4 the direct form has lost 7 of 16 digits, while 2sin^2(x/2) keeps at least 15 down to x = 10^-7.</summary>
    <category term="math"/>
    <category term="floating point"/>
  </entry>
  <entry>
    <title>Householder and Givens keep Q orthogonal at any condition number</title>
    <link href="https://viv-lang.org/p/qr-orthogonality"/>
    <id>https://viv-lang.org/p/qr-orthogonality</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>|| Q^T Q - I || stays below 10 nu from κ = 10 to 10^12, while Gram-Schmidt grows like uκ or uκ^2.</summary>
    <category term="math"/>
    <category term="linalg"/>
  </entry>
  <entry>
    <title>The quadratic formula loses the small root</title>
    <link href="https://viv-lang.org/p/quadratic-cancellation"/>
    <id>https://viv-lang.org/p/quadratic-cancellation</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>For x^2 - 10^8x + 1 = 0 the textbook small root is off by 25%, while c/q gets it to 10^-15.</summary>
    <category term="math"/>
    <category term="floating point"/>
  </entry>
  <entry>
    <title>Chebyshev nodes tame Runge's function</title>
    <link href="https://viv-lang.org/p/runge-chebyshev"/>
    <id>https://viv-lang.org/p/runge-chebyshev</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>At degree 20 equally spaced nodes err by 60 and Chebyshev nodes by 0.018; at degree 40 Chebyshev is below 10^-3.</summary>
    <category term="math"/>
    <category term="approximation"/>
  </entry>
  <entry>
    <title>Spectral derivatives beat every power of N</title>
    <link href="https://viv-lang.org/p/spectral-derivative"/>
    <id>https://viv-lang.org/p/spectral-derivative</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>The spectral error is below 10^-12 by N = 32; the central difference falls like h^2 and is above 10^-4 at N = 128.</summary>
    <category term="math"/>
    <category term="approximation"/>
  </entry>
  <entry>
    <title>On a stiff problem an explicit solver takes hundreds of times the steps</title>
    <link href="https://viv-lang.org/p/stiff-robertson"/>
    <id>https://viv-lang.org/p/stiff-robertson</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>On Robertson's problem Dormand-Prince takes 34,537 steps, Radau IIA 78 and BDF 144, and all three end within 10^-6 of the reference.</summary>
    <category term="math"/>
    <category term="differential equations"/>
  </entry>
  <entry>
    <title>Pairwise summation keeps the rounding error of a sum small</title>
    <link href="https://viv-lang.org/p/summation-order"/>
    <id>https://viv-lang.org/p/summation-order</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>On 2^20 uniform numbers pairwise summation errs by under 5u∑|t|, left to right by about 50u∑|t|.</summary>
    <category term="math"/>
    <category term="floating point"/>
  </entry>
  <entry>
    <title>The trapezoid rule is spectrally accurate on periodic functions</title>
    <link href="https://viv-lang.org/p/trapezoid-periodic"/>
    <id>https://viv-lang.org/p/trapezoid-periodic</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>16 points give ∫ e^(cos t) dt to 10^-14, while e^x on [0, 1] is off by 3.3 × 10^-4.</summary>
    <category term="math"/>
    <category term="quadrature"/>
  </entry>
  <entry>
    <title>The one-pass variance comes out negative on four numbers</title>
    <link href="https://viv-lang.org/p/variance-one-pass"/>
    <id>https://viv-lang.org/p/variance-one-pass</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>For 10^9 + 4, +7, +13, +16 (variance 30) the one-pass formula gives -171; Welford's update gives 30.</summary>
    <category term="math"/>
    <category term="floating point"/>
  </entry>
  <entry>
    <title>DC power flow gets worse as the grid loads up</title>
    <link href="https://viv-lang.org/p/dc-error-with-loading"/>
    <id>https://viv-lang.org/p/dc-error-with-loading</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>On case118 the DC branch-flow error is 8% at half load, 13% at base load and 52% at three times base load.</summary>
    <category term="power"/>
    <category term="power flow"/>
  </entry>
  <entry>
    <title>Sparse Newton power flow time grows like n^1.2 to n^1.4</title>
    <link href="https://viv-lang.org/p/sparse-newton-scales-linearly"/>
    <id>https://viv-lang.org/p/sparse-newton-scales-linearly</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>Up to 2,383 buses Newton converges in at most 6 iterations, and its solve time grows with the bus count at a fitted log-log slope between 1.0 and 1.6.</summary>
    <category term="power"/>
    <category term="power flow"/>
  </entry>
  <entry>
    <title>LDA atoms miss the virial theorem by under 5%</title>
    <link href="https://viv-lang.org/p/atom-virial"/>
    <id>https://viv-lang.org/p/atom-virial</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>-V/T exceeds 2 by 4.9% for hydrogen down to 0.19% for argon, with energies within 5 × 10^-7 hartree of NIST.</summary>
    <category term="science"/>
    <category term="atomic structure"/>
  </entry>
  <entry>
    <title>Strong charges still screen at the Debye length</title>
    <link href="https://viv-lang.org/p/debye-screening"/>
    <id>https://viv-lang.org/p/debye-screening</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>The decay length is λ_D to 0.1% at Q = 0.1 and at Q = 20; the strong sphere's surface potential is 32% of Debye-Hückel's.</summary>
    <category term="science"/>
    <category term="plasma and electrolytes"/>
  </entry>
  <entry>
    <title>Binder cumulants find the Ising critical point within 1%</title>
    <link href="https://viv-lang.org/p/ising-binder-crossing"/>
    <id>https://viv-lang.org/p/ising-binder-crossing</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>The crossings are at 2.263 and 2.269 against Onsager's T_c = 2.2692; the susceptibility grows with slope 1.76, near 7/4.</summary>
    <category term="science"/>
    <category term="statistical mechanics"/>
  </entry>
  <entry>
    <title>Spin-orbit coupling makes 28 a magic number</title>
    <link href="https://viv-lang.org/p/spin-orbit-magic-28"/>
    <id>https://viv-lang.org/p/spin-orbit-magic-28</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>In calcium-40 the gap at 28 neutrons is 4.4 MeV; with W_0 = 0 it closes, while the gaps at 8 and 20 widen past 10 MeV.</summary>
    <category term="science"/>
    <category term="nuclear structure"/>
  </entry>
  <entry>
    <title>Nuclear spin-orbit splitting rivals the shell gap</title>
    <link href="https://viv-lang.org/p/spin-orbit-nuclei-vs-atoms"/>
    <id>https://viv-lang.org/p/spin-orbit-nuclei-vs-atoms</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>In oxygen-16 the 1p splitting is 6.2 MeV, 40% of the shell gap; in hydrogen fine structure is 4.4 × 10^-6 of the gap.</summary>
    <category term="science"/>
    <category term="nuclear and atomic structure"/>
  </entry>
  <entry>
    <title>Logistic regression on separated data never converges</title>
    <link href="https://viv-lang.org/p/logistic-separation"/>
    <id>https://viv-lang.org/p/logistic-separation</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>The slope grows by 2.0 per IRLS iteration, from 4.6 to 44.7, while the deviance falls by a factor of about e each step.</summary>
    <category term="stats"/>
    <category term="generalized linear models"/>
  </entry>
  <entry>
    <title>QR keeps the digits the normal equations lose</title>
    <link href="https://viv-lang.org/p/lstsq-qr-vs-normal-equations"/>
    <id>https://viv-lang.org/p/lstsq-qr-vs-normal-equations</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>On nine NIST datasets QR keeps at least 7.5 digits and leads the normal equations by at least 2; on Filip Cholesky keeps none.</summary>
    <category term="stats"/>
    <category term="linear regression"/>
  </entry>
  <entry>
    <title>Twenty tests on pure noise find something 64.7% of the time</title>
    <link href="https://viv-lang.org/p/multiple-testing"/>
    <id>https://viv-lang.org/p/multiple-testing</id>
    <published>2026-10-14T12:00:00Z</published>
    <updated>2026-10-14T12:00:00Z</updated>
    <summary>At least one of 20 z-tests is significant in 64.7% of 10,000 studies, as 1 - 0.95^20 = 0.6415 predicts; Bonferroni brings it to 5%.</summary>
    <category term="stats"/>
    <category term="hypothesis testing"/>
  </entry>
  <entry>
    <title>A random walk spreads as 2Dt and turns Gaussian</title>
    <link href="https://viv-lang.org/p/a-random-walk-becomes-diffusion"/>
    <id>https://viv-lang.org/p/a-random-walk-becomes-diffusion</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>4000 walkers each take 200 random steps, drawn evenly from an interval. Their mean squared distance from the start grows in a straight line, 2Dt, with the diffusion constant D = 0.5 set by the step size; a line through the measurements gives D = 0.5004 ± 0.0098. After one step the walkers are spread flat, and by step 200 they are spread as the Gaussian that solves the diffusion equation: the flatness measure called excess kurtosis falls as -6/(5n), from -1.2 to zero within the noise.</summary>
    <category term="random walk"/>
    <category term="diffusion"/>
    <category term="central limit theorem"/>
    <category term="monte carlo"/>
    <category term="notebook"/>
  </entry>
  <entry>
    <title>BFGS against gradient descent on the Rosenbrock valley</title>
    <link href="https://viv-lang.org/p/bfgs-against-gradient-descent-on-rosenbrock"/>
    <id>https://viv-lang.org/p/bfgs-against-gradient-descent-on-rosenbrock</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>Both methods start at (-1.2, 1) on Rosenbrock's function and use the same backtracking line search; they differ only in the direction they search along. BFGS is within 10^-9 of the minimum at (1, 1) after 35 iterations and has a zero gradient to 10^-12 after 36. Gradient descent takes 22,962 iterations to get within 10^-9, and near the minimum it gains a factor of only 0.99919 per step, close to (κ - 1)/(κ + 1) for the Hessian's condition number κ = 2508.</summary>
    <category term="optimization"/>
    <category term="bfgs"/>
    <category term="quasi-newton"/>
    <category term="gradient descent"/>
    <category term="line search"/>
    <category term="notebook"/>
  </entry>
  <entry>
    <title>Black-Scholes by Monte Carlo, against the closed form</title>
    <link href="https://viv-lang.org/p/black-scholes-by-monte-carlo"/>
    <id>https://viv-lang.org/p/black-scholes-by-monte-carlo</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>The price of a one-year call option on a $100 stock with strike $100, 5% interest and 20% volatility is $10.4506 by the Black-Scholes formula. Simulating the stock price 131072 times and averaging the discounted payoff gives $10.371, 1.95 standard errors away. The error shrinks as 1/sqrt(N): its measured slope on a log-log plot is -0.488, against -0.5, and the standard error 14.72/sqrt(N) comes from an exact formula for the payoff's spread.</summary>
    <category term="finance"/>
    <category term="options"/>
    <category term="black-scholes"/>
    <category term="monte carlo"/>
    <category term="convergence"/>
    <category term="notebook"/>
  </entry>
  <entry>
    <title>Burgers' equation in nonconservative form puts the shock in the wrong place</title>
    <link href="https://viv-lang.org/p/burgers-in-nonconservative-form-puts-the-shock-in-the-wrong-place"/>
    <id>https://viv-lang.org/p/burgers-in-nonconservative-form-puts-the-shock-in-the-wrong-place</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>For smooth solutions, u_t + (u^2/2)_x = 0 and u_t + u u_x = 0 are the same equation. For a shock from u_L = 1 to u_R = 0.25 they are not. A scheme built on the first form, Godunov's, moves the shock at 0.625, the Rankine-Hugoniot speed (u_L + u_R)/2, to rounding. Upwinding the second form moves it at 0.5132, on 400, 800 and 1600 cells alike, so refining the grid does not fix it. With u_R = 0 the nonconservative shock stays at x = 0, with speed 0.</summary>
    <category term="pde"/>
    <category term="burgers"/>
    <category term="shocks"/>
    <category term="conservation laws"/>
    <category term="rankine-hugoniot"/>
    <category term="godunov"/>
    <category term="notebook"/>
  </entry>
  <entry>
    <title>Excitation energies of water from the Casida equation, with and without de-excitations</title>
    <link href="https://viv-lang.org/p/casida-tdhf-and-tda-for-water"/>
    <id>https://viv-lang.org/p/casida-tdhf-and-tda-for-water</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>Water in the 6-31G basis, from its Hartree-Fock ground state to all 40 singlet and 40 triplet excitation energies, two ways. Time-dependent Hartree-Fock (the random-phase approximation) keeps the coupling B between excitations and de-excitations; the Tamm-Dancoff approximation drops it and diagonalizes A alone. The lowest singlet is at 0.344074 Ha (9.363 eV) in TDHF and 0.346161 Ha in TDA, and every one of the 160 energies matches PySCF's to 10^-8 Ha.</summary>
    <category term="quantum chemistry"/>
    <category term="excited states"/>
    <category term="tdhf"/>
    <category term="rpa"/>
    <category term="tamm-dancoff"/>
    <category term="cis"/>
    <category term="casida"/>
    <category term="pyscf"/>
  </entry>
  <entry>
    <title>The double scroll of Chua's circuit</title>
    <link href="https://viv-lang.org/p/chuas-circuit-double-scroll"/>
    <id>https://viv-lang.org/p/chuas-circuit-double-scroll</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>Two capacitors, an inductor, a resistor and one diode whose current is a three-piece straight line. The voltages never settle and never repeat: they wind around two centers, hopping between them at irregular times. Nearby starts separate like e^(λ t) with λ = 0.33, which is what a separate scipy calculation gives within the scatter expected of a run this long.</summary>
    <category term="chaos"/>
    <category term="circuits"/>
    <category term="lyapunov exponents"/>
    <category term="odes"/>
  </entry>
  <entry>
    <title>Crank-Nicolson is second order in time, backward Euler first</title>
    <link href="https://viv-lang.org/p/crank-nicolson-is-second-order-in-time"/>
    <id>https://viv-lang.org/p/crank-nicolson-is-second-order-in-time</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>The heat equation u_t = u_xx from u(x, 0) = x(1 - x), stepped to t = 0.1 with six time steps from 0.02 down to 0.000625. Each halving cuts the Crank-Nicolson error by a factor of 4.0 to 4.7 (measured order 2.09 to 2.23, then 2.000) and the backward Euler error by 1.9 to 2.0 (order 0.94 to 0.996). The errors are measured against the exact solution of the space-discretized equation, a discrete sine series. Against the exact Fourier series of the PDE, the Crank-Nicolson error stops falling at the space error, 1.95 × 10^-6.</summary>
    <category term="pde"/>
    <category term="heat equation"/>
    <category term="crank-nicolson"/>
    <category term="backward euler"/>
    <category term="order of accuracy"/>
    <category term="notebook"/>
  </entry>
  <entry>
    <title>Electron mobility fitted to NIST's certified digits</title>
    <link href="https://viv-lang.org/p/fitting-electron-mobility-with-minpack"/>
    <id>https://viv-lang.org/p/fitting-electron-mobility-with-minpack</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>A seven-parameter rational model fitted to NIST's semiconductor electron-mobility data by lmder, the Levenberg-Marquardt routine of MINPACK, translated to Viv step by step. Every trial step matches a gfortran build of the original Fortran to the last bit, the answer matches scipy.optimize.leastsq, and the parameters land within 0.001 standard deviations of NIST's certified values.</summary>
    <category term="least squares"/>
    <category term="levenberg-marquardt"/>
    <category term="minpack"/>
    <category term="curve fitting"/>
    <category term="nist"/>
  </entry>
  <entry>
    <title>Forward and backward Euler on either side of h = 2/λ</title>
    <link href="https://viv-lang.org/p/forward-euler-blows-up-past-h-equals-2-over-lambda"/>
    <id>https://viv-lang.org/p/forward-euler-blows-up-past-h-equals-2-over-lambda</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>The exact solution of this equation is cos t, which a step of 0.1 would follow to a few digits. With λ = 1000, forward Euler is within 4 × 10^-7 of it at t = 2 with h = 0.0019, and off by 2.7 × 10^33 at h = 0.0021. A disturbance is multiplied by 1 - hλ each step, and the measured factor matches |1 - hλ| to 2 × 10^-14 at 36 step sizes. Backward Euler's factor is 1/(1 + hλ), below 1 at every step size, and at h = 0.1 it is still within 2 × 10^-5 of cos 2.</summary>
    <category term="ode"/>
    <category term="stiffness"/>
    <category term="forward euler"/>
    <category term="backward euler"/>
    <category term="stability"/>
    <category term="notebook"/>
  </entry>
  <entry>
    <title>Gauss-Legendre quadrature against tanh-sinh on a smooth and a singular integral</title>
    <link href="https://viv-lang.org/p/gauss-legendre-quadrature-and-where-tanh-sinh-wins"/>
    <id>https://viv-lang.org/p/gauss-legendre-quadrature-and-where-tanh-sinh-wins</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>Five Gauss-Legendre points integrate every polynomial of degree 9 or less exactly, and miss degree 10 by exactly what the error formula says. On e^x seven points reach rounding. On 1/sqrt(1 - x^2), which is infinite at both ends of the interval, 128 points still miss by 1.4 × 10^-2, and the error only halves when the points double. The tanh-sinh rule gets that integral to rounding with 37 points.</summary>
    <category term="quadrature"/>
    <category term="integration"/>
    <category term="gauss-legendre"/>
    <category term="tanh-sinh"/>
    <category term="notebook"/>
  </entry>
  <entry>
    <title>Grad-Shafranov by finite differences, against Solov'ev's closed form</title>
    <link href="https://viv-lang.org/p/grad-shafranov-solovev"/>
    <id>https://viv-lang.org/p/grad-shafranov-solovev</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>A tokamak equilibrium solved on a grid and graded against an exact one. Solov'ev's ψ = (R^2-1)^2/8 + R^2Z^2/(2κ^2) solves the Grad-Shafranov equation with constant pressure gradient; the five-point solver, relaxed by SOR until the residual is below 10^-11, misses it by 1.68×10^-4, 4.21×10^-5 and 1.06×10^-5 on grids of spacing 0.1, 0.05 and 0.025, an observed order of 1.995 and then 1.994. Those errors are scipy's direct solve of the same equations, to 10^-10.</summary>
    <category term="plasma"/>
    <category term="mhd"/>
    <category term="tokamak"/>
    <category term="equilibrium"/>
    <category term="grad-shafranov"/>
    <category term="finite differences"/>
    <category term="sor"/>
  </entry>
  <entry>
    <title>Graphene's Dirac cones</title>
    <link href="https://viv-lang.org/p/graphenes-dirac-cones"/>
    <id>https://viv-lang.org/p/graphenes-dirac-cones</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>An electron hopping between neighboring carbon atoms of a honeycomb has two energy bands, and they touch at the corners of the Brillouin zone. Near a corner the energy rises in a straight line in every direction, a cone, with slope v_F = 3ta/2ℏ. A centered finite difference at the corner gives 1.5 to eight digits in every direction.</summary>
    <category term="graphene"/>
    <category term="tight binding"/>
    <category term="band structure"/>
    <category term="dirac cones"/>
    <category term="fermi velocity"/>
  </entry>
  <entry>
    <title>RHF, UHF and full CI for H₂ in STO-3G along the bond</title>
    <link href="https://viv-lang.org/p/h2-rhf-uhf-and-full-ci-along-the-bond"/>
    <id>https://viv-lang.org/p/h2-rhf-uhf-and-full-ci-along-the-bond</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>Pull the two atoms of H₂ apart in the smallest basis there is, and compute its energy three ways. Restricted Hartree-Fock is off by 0.021 Ha at the equilibrium bond length and heads for the wrong limit, 0.39 Ha too high. Unrestricted Hartree-Fock splits from it at R = 2.180 bohr and reaches two hydrogen atoms. Full CI is exact in this basis. Every energy matches PySCF to 10^-9 Ha.</summary>
    <category term="hartree-fock"/>
    <category term="full ci"/>
    <category term="correlation energy"/>
    <category term="bond breaking"/>
    <category term="sto-3g"/>
    <category term="pyscf"/>
  </entry>
  <entry>
    <title>The Hasegawa-Wakatani drift-wave model</title>
    <link href="https://viv-lang.org/p/hasegawa-wakatani-one-rung-at-a-time"/>
    <id>https://viv-lang.org/p/hasegawa-wakatani-one-rung-at-a-time</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>The Hasegawa-Wakatani equations are the simplest model of drift-wave turbulence at the edge of a tokamak that contains the instability driving it. Five rungs build their linear theory: the drift-wave frequency, the growth rate as the eigenvalue of a 2×2 matrix (0.098684 at C = 1, as numpy's eigensolver gives), the return to the drift wave as C → ∞ at the predicted rates 1/C and 1/C^2, a zonal flow that keeps k^2/(1+k^2) of its start as it relaxes, and the one-line change in the modified model that leaves it untouched.</summary>
    <category term="plasma"/>
    <category term="drift waves"/>
    <category term="turbulence"/>
    <category term="zonal flows"/>
    <category term="eigenvalues"/>
    <category term="ladder"/>
  </entry>
  <entry>
    <title>Jacobi's eigenvalue method</title>
    <link href="https://viv-lang.org/p/jacobi-eigenvalue-sweeps"/>
    <id>https://viv-lang.org/p/jacobi-eigenvalue-sweeps</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>Jacobi's method diagonalizes a symmetric matrix by plane rotations, each of which zeroes one off-diagonal pair. On an 8 by 8 matrix the off-diagonal norm goes 1.33, 0.453, 0.0299, 3.2 × 10^-5, 8 × 10^-13 over four sweeps, and after the fifth it is under 10^-15, rounding error. The diagonal is then the spectrum, and it matches numpy.linalg.eigh to 10^-14.</summary>
    <category term="eigenvalues"/>
    <category term="linear-algebra"/>
    <category term="jacobi"/>
    <category term="convergence"/>
    <category term="notebook"/>
  </entry>
  <entry>
    <title>Jacobi, SOR and conjugate gradients on the Poisson equation</title>
    <link href="https://viv-lang.org/p/jacobi-sor-and-cg-on-the-poisson-equation"/>
    <id>https://viv-lang.org/p/jacobi-sor-and-cg-on-the-poisson-equation</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>The five-point Poisson equation on a 15 by 15 grid, solved to a relative residual of 10^-8 four ways. Jacobi takes 948 sweeps, Gauss-Seidel 475, SOR with the optimal factor 60, and conjugate gradients 25 iterations. Each count follows from one number the theory predicts: Jacobi's error shrinks by cos π h per sweep once the smoothest mode dominates, Gauss-Seidel's by its square, and SOR and CG depend on sqrt(κ) ∝ 1/h. Halve h and Jacobi takes four times as many sweeps; SOR and CG take twice as many.</summary>
    <category term="linear-algebra"/>
    <category term="iterative methods"/>
    <category term="poisson"/>
    <category term="sor"/>
    <category term="conjugate gradient"/>
    <category term="notebook"/>
  </entry>
  <entry>
    <title>Three floating-point failures in summation, cancellation and RANDU</title>
    <link href="https://viv-lang.org/p/kahan-summation-horner-noise-and-randus-planes"/>
    <id>https://viv-lang.org/p/kahan-summation-horner-noise-and-randus-planes</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>Adding 1/k for k up to a million left to right ends 414 units in the last place (ulps) from the correctly rounded sum; Kahan's compensated sum is correctly rounded at all 31 checkpoints from 1 to 10^6. Evaluating (x - 1)^7 from its expanded coefficients near x = 1 gives rounding noise: 89 sign changes among 401 points, where the polynomial has one, and 8.5 times the true value at x = 1.005. The factored form is within 1.4ε everywhere. The random number generator RANDU puts every triple of successive draws on one of 15 planes.</summary>
    <category term="floating point"/>
    <category term="rounding"/>
    <category term="kahan summation"/>
    <category term="horner"/>
    <category term="cancellation"/>
    <category term="random numbers"/>
    <category term="notebook"/>
  </entry>
  <entry>
    <title>Kinetic Monte Carlo against the master equation</title>
    <link href="https://viv-lang.org/p/kinetic-monte-carlo-against-the-master-equation"/>
    <id>https://viv-lang.org/p/kinetic-monte-carlo-against-the-master-equation</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>A molecule hops between three states, A to B to C and back, at fixed rates. The master equation gives the exact probability of each state at every time; kinetic Monte Carlo instead follows 10000 molecules one random jump at a time. At 25 times the fraction of molecules in each state matches the exact probability within four standard errors, the intermediate B rises to 0.460 and falls back, and the mean time to first reach C, exactly 1.75, is measured as 1.721 ± 0.014.</summary>
    <category term="kinetic monte carlo"/>
    <category term="gillespie"/>
    <category term="master equation"/>
    <category term="markov chains"/>
    <category term="notebook"/>
  </entry>
  <entry>
    <title>Lanczos finds the largest eigenvalue three times</title>
    <link href="https://viv-lang.org/p/lanczos-loses-orthogonality"/>
    <id>https://viv-lang.org/p/lanczos-loses-orthogonality</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>Sixty steps of Lanczos on a 200 by 200 symmetric matrix whose eigenvalues are known exactly. Both ends of the spectrum, ± 4, come out right to 10^-14. But in floating point the basis stops being orthogonal once the top eigenvalue has converged, the direction of its eigenvector creeps back in, and the eigenvalue 4, which the matrix has once, is found again and again. Orthogonalizing each new vector against all the old ones stops it.</summary>
    <category term="eigenvalues"/>
    <category term="linear-algebra"/>
    <category term="lanczos"/>
    <category term="krylov"/>
    <category term="rounding"/>
    <category term="notebook"/>
  </entry>
  <entry>
    <title>Landau damping from the root of the dispersion relation</title>
    <link href="https://viv-lang.org/p/landau-damping-from-the-dispersion-relation"/>
    <id>https://viv-lang.org/p/landau-damping-from-the-dispersion-relation</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>A Langmuir wave in a collisionless plasma still decays: electrons moving near its phase velocity take energy from it. Newton's method on the kinetic dispersion relation, with the plasma dispersion function from lib/zfunc, puts the least-damped root at kλ_D = 0.5 at ω = 1.415662 - 0.153359i (in units of ω_pe), matching a 30-digit mpmath root to 10^-12. The usual small-k damping formula is 1.3% off there and 59% off at kλ_D = 0.3.</summary>
    <category term="plasma"/>
    <category term="kinetic theory"/>
    <category term="landau damping"/>
    <category term="dispersion relation"/>
    <category term="complex roots"/>
    <category term="newton"/>
    <category term="notebook"/>
  </entry>
  <entry>
    <title>Make Euler stable on a stiff equation</title>
    <link href="https://viv-lang.org/p/make-euler-stable-on-a-stiff-equation"/>
    <id>https://viv-lang.org/p/make-euler-stable-on-a-stiff-equation</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>The solution of y' = -50y decays to zero, but forward Euler with step h = 0.05 multiplies y by 1 - 50h = -1.5 every step, and after 12 steps it is 129.7 instead of 10^-13. Rewrite decay_step and system_step as backward Euler, which takes the slope at the end of the step instead of the start, so that no step size makes them grow.</summary>
    <category term="ode"/>
    <category term="stiffness"/>
    <category term="implicit methods"/>
    <category term="backward euler"/>
    <category term="problem"/>
  </entry>
  <entry>
    <title>Make Gram-Schmidt orthogonal to rounding</title>
    <link href="https://viv-lang.org/p/make-gram-schmidt-orthogonal-to-rounding"/>
    <id>https://viv-lang.org/p/make-gram-schmidt-orthogonal-to-rounding</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>Ten nearly parallel vectors, each e_0 plus a tiny 10^-8 in its own direction. Classical Gram-Schmidt turns them into ten &quot;orthonormal&quot; vectors of which two are at 60 degrees: their dot product is 0.5. Rewrite orthonormalize so the vectors it returns are orthogonal to 10^-15 and equal the exact ones to 10^-12.</summary>
    <category term="linear algebra"/>
    <category term="gram-schmidt"/>
    <category term="orthogonalization"/>
    <category term="rounding"/>
    <category term="problem"/>
  </entry>
  <entry>
    <title>Make Numerov find the decaying solution</title>
    <link href="https://viv-lang.org/p/make-numerov-find-the-decaying-solution"/>
    <id>https://viv-lang.org/p/make-numerov-find-the-decaying-solution</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>Numerov's method integrates y'' = y outward from y(0) = 1, y(h) = e^(-h), aiming at the decaying solution e^(-x). By x = 9 it is off by a factor of 30, and by x = 18 by 2 × 10^9. Rewrite decaying so that it follows e^(-x) to Numerov's own accuracy, within 2.7 × 10^-5, on both intervals.</summary>
    <category term="ode"/>
    <category term="numerov"/>
    <category term="shooting"/>
    <category term="stability"/>
    <category term="problem"/>
  </entry>
  <entry>
    <title>Make power iteration converge on a tied pair</title>
    <link href="https://viv-lang.org/p/make-power-iteration-converge-on-a-tied-pair"/>
    <id>https://viv-lang.org/p/make-power-iteration-converge-on-a-tied-pair</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>Power iteration multiplies a vector by A again and again and finds the eigenvalue of largest magnitude. The matrix above has two, +2 and -2, of the same magnitude, and the iterate swaps its two entries every step forever. Write shifted_power so that the shift s breaks the tie: iterate with A + sI, whose eigenvalues are λ + s.</summary>
    <category term="eigenvalues"/>
    <category term="power iteration"/>
    <category term="shifts"/>
    <category term="linear algebra"/>
    <category term="problem"/>
  </entry>
  <entry>
    <title>Make the heat-equation step stable past r = 1/2</title>
    <link href="https://viv-lang.org/p/make-the-heat-equation-step-stable"/>
    <id>https://viv-lang.org/p/make-the-heat-equation-step-stable</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>The explicit (FTCS) step for u_t = u_xx multiplies the grid's most jagged mode by about 1 - 4r each step, and for r = 0.6 that is -1.4: a checkerboard that should fade grows to 215 in 16 steps. Rewrite heat_step as backward Euler, which needs a tridiagonal solve per step and damps every mode for every r.</summary>
    <category term="pde"/>
    <category term="heat equation"/>
    <category term="stability"/>
    <category term="implicit methods"/>
    <category term="problem"/>
  </entry>
  <entry>
    <title>Metropolis sampling finds Onsager's magnetization</title>
    <link href="https://viv-lang.org/p/metropolis-ising-against-onsager"/>
    <id>https://viv-lang.org/p/metropolis-ising-against-onsager</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>A 16 by 16 grid of spins, each flipped at random by the Metropolis rule, settles at T = 1.8 to an average magnetization of 0.9567 ± 0.0013. The exact infinite-lattice answer, from Onsager and Yang, is 0.95686. The critical temperature 2/ln(1 + sqrt(2)) = 2.26919 is where that formula reaches zero.</summary>
    <category term="ising model"/>
    <category term="monte carlo"/>
    <category term="phase transitions"/>
  </entry>
  <entry>
    <title>Nuclear level density, by counting the states</title>
    <link href="https://viv-lang.org/p/nuclear-level-density-by-counting"/>
    <id>https://viv-lang.org/p/nuclear-level-density-by-counting</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>Put 100 fermions in equally spaced levels and count, one by one, the states with excitation energy E. The counts are the partition numbers 1, 1, 2, 3, 5, 7, 11, …, exactly, up to p(100) = 190569292. They grow like Bethe's e^(2sqrt(aE)); at E = 100 the count is 4.4% below the leading Hardy-Ramanujan term, and the next term of the series, -0.4433/sqrt(E), accounts for all but 0.06% of that.</summary>
    <category term="level density"/>
    <category term="fermi gas"/>
    <category term="partitions"/>
    <category term="combinatorics"/>
  </entry>
  <entry>
    <title>Neutron pairing in a neutron-star crust</title>
    <link href="https://viv-lang.org/p/pairing-in-the-neutron-star-crust"/>
    <id>https://viv-lang.org/p/pairing-in-the-neutron-star-crust</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>One cell of the neutron-star inner crust in one dimension: a slab of nuclear matter in a gas of free neutrons, with a contact pairing force. Solving the Bogoliubov-de Gennes equations self-consistently gives a pairing gap of 0.9151 MeV in the gas and 0.1518 MeV at the middle of the slab, as a separate numpy solver finds. The same code on a uniform ring reproduces the BCS gap equation's 0.961089 MeV to 10^-8.</summary>
    <category term="nuclear physics"/>
    <category term="neutron stars"/>
    <category term="superfluidity"/>
    <category term="pairing"/>
    <category term="bogoliubov-de gennes"/>
    <category term="hartree-fock-bogoliubov"/>
  </entry>
  <entry>
    <title>Silicon's band structure, from the crystal up</title>
    <link href="https://viv-lang.org/p/silicon-bands-from-the-crystal-up"/>
    <id>https://viv-lang.org/p/silicon-bands-from-the-crystal-up</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>A density-functional calculation of silicon, one cell at a time: the crystal, a plane-wave basis, the pseudopotential, the Hamiltonian, the self-consistent loop and the bands from L through Gamma to X. It runs at a 5 Ha cutoff on four k-points so it fits in a browser tab; its tests check each stage, from the basis sizes to the band energies, against an independent numpy implementation at the same settings.</summary>
    <category term="dft"/>
    <category term="plane waves"/>
    <category term="pseudopotentials"/>
    <category term="band structure"/>
    <category term="silicon"/>
    <category term="notebook"/>
  </entry>
  <entry>
    <title>Skyrme Hartree-Fock of oxygen-16</title>
    <link href="https://viv-lang.org/p/skyrme-hartree-fock-of-oxygen-16"/>
    <id>https://viv-lang.org/p/skyrme-hartree-fock-of-oxygen-16</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>The ground state of ^16O from the SLy5 Skyrme functional, solved on a radial mesh at two spacings and extrapolated. The binding energy comes out 8.0250 MeV per nucleon and the charge radius 2.7993 fm; skyrme_rpa, the published code of Colò et al. (2013), gives 8.0261 MeV and 2.7991 fm in its own test run with the same force, and the six single-particle energies agree with it to 3 keV.</summary>
    <category term="nuclear physics"/>
    <category term="hartree-fock"/>
    <category term="skyrme"/>
    <category term="density functional"/>
    <category term="sly5"/>
    <category term="binding energy"/>
    <category term="charge radius"/>
  </entry>
  <entry>
    <title>A gyro-orbit and the E×B drift by the Boris push</title>
    <link href="https://viv-lang.org/p/the-boris-push-gyrates-and-drifts"/>
    <id>https://viv-lang.org/p/the-boris-push-gyrates-and-drifts</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>The Boris push moves a charged particle through electric and magnetic fields in almost every particle-in-cell code. In a magnetic field alone it keeps the speed to rounding and puts every position on one circle; the gyroperiod comes out 6.28449 instead of 2π, longer by (ω_c Δ t)^2/12. With an electric field added, a particle started at mathbf E × mathbf B / B^2 moves at exactly that velocity forever, and any other start averages to it.</summary>
    <category term="plasma"/>
    <category term="particle pushers"/>
    <category term="boris"/>
    <category term="gyration"/>
    <category term="drift"/>
    <category term="notebook"/>
  </entry>
  <entry>
    <title>The error of a linear solve follows the condition number</title>
    <link href="https://viv-lang.org/p/the-error-follows-the-condition-number"/>
    <id>https://viv-lang.org/p/the-error-follows-the-condition-number</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>Gaussian elimination with partial pivoting solves Hilbert systems whose exact solution is all ones. From n = 3 to 12 the condition number κ grows from 524 to 1.7 × 10^16, and the error grows with it, staying between 0.005 and 0.18 times κε, while the residual stays under ε. In least squares, fitting a degree-11 polynomial to 40 points, Householder QR is off by 3.6 × 10^-9 (about κε), and the normal equations, which square κ, by 0.18.</summary>
    <category term="linear algebra"/>
    <category term="conditioning"/>
    <category term="hilbert matrix"/>
    <category term="least squares"/>
    <category term="householder qr"/>
    <category term="normal equations"/>
    <category term="notebook"/>
  </entry>
  <entry>
    <title>A star of free neutrons can weigh at most 0.71 suns</title>
    <link href="https://viv-lang.org/p/the-free-neutron-star-limit"/>
    <id>https://viv-lang.org/p/the-free-neutron-star-limit</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>Hold a ball of neutrons up by their Fermi pressure alone, with gravity from general relativity, and solve for the star at each central density. The mass rises, peaks at 0.7102 solar masses with a radius of 9.16 km, and falls: no heavier star of free neutrons exists. A scipy twin written in different variables gets 0.71018, and Narain, Schaffner-Bielich and Mishustin (2006) quote 0.710.</summary>
    <category term="neutron stars"/>
    <category term="general relativity"/>
    <category term="tov equations"/>
    <category term="fermi gas"/>
  </entry>
  <entry>
    <title>The two-pion loop function, built and differentiated by a small computer algebra system</title>
    <link href="https://viv-lang.org/p/the-pion-loop-function-by-computer-algebra"/>
    <id>https://viv-lang.org/p/the-pion-loop-function-by-computer-algebra</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>The loop function L(q) sets the momentum dependence of the two-pion-exchange nuclear force at next-to-leading order. The program writes it as an expression tape, evaluates it, and differentiates the tape symbolically into a second tape. Both are checked against a 30-digit Feynman-parameter integral that never uses the closed form: L(200 MeV) = 1.14642288565 and dL/dq = 1.24075106×10^-3/MeV there, to 10^-14 and 2×10^-17/MeV.</summary>
    <category term="nuclear physics"/>
    <category term="chiral effective field theory"/>
    <category term="two-pion exchange"/>
    <category term="computer algebra"/>
    <category term="symbolic differentiation"/>
    <category term="expression tape"/>
  </entry>
  <entry>
    <title>Tunneling through one and two barriers by transfer matrices</title>
    <link href="https://viv-lang.org/p/transfer-matrices-and-resonant-tunneling"/>
    <id>https://viv-lang.org/p/transfer-matrices-and-resonant-tunneling</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>An electron meets a barrier it does not have the energy to climb. Chop the potential into flat pieces, and the wave on each side of every edge is related by a 2 by 2 matrix; the product of those matrices gives the chance of getting through, T, and of bouncing back, R. They add to 1 at every energy, to within 10^-13. Two barriers 4 apart, each of which alone lets through less than 1% at E = 0.2108, together let through 100% at that energy.</summary>
    <category term="quantum mechanics"/>
    <category term="scattering"/>
    <category term="tunneling"/>
    <category term="transfer matrix"/>
    <category term="resonance"/>
    <category term="notebook"/>
  </entry>
  <entry>
    <title>The bounce period of an electron trapped in a plasma wave</title>
    <link href="https://viv-lang.org/p/trapped-electron-bounce-period"/>
    <id>https://viv-lang.org/p/trapped-electron-bounce-period</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>In the frame of a large-amplitude plasma wave, an electron near the wave's phase velocity moves like a pendulum. Released 0.1 radian from the bottom of a trough, it takes 6.287115 time units to bounce back, which is 4K(sin^2 0.05) from the complete elliptic integral, and 2π(1 + θ_0^2/16) to six digits. Electrons with speed below 2ω_B/k at the trough stay in it; faster ones pass over the crests.</summary>
    <category term="plasma"/>
    <category term="nonlinear waves"/>
    <category term="trapping"/>
    <category term="landau damping"/>
    <category term="pendulum"/>
    <category term="elliptic integral"/>
  </entry>
  <entry>
    <title>The two-stream instability in a particle-in-cell code</title>
    <link href="https://viv-lang.org/p/two-stream-instability-in-a-particle-code"/>
    <id>https://viv-lang.org/p/two-stream-instability-in-a-particle-code</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>Two cold electron beams passing through each other are unstable. A particle-in-cell code with 2000 particles measures the growth rate of the fastest mode as 0.35366 ω_p; cold-beam linear theory gives 1/(2sqrt(2)) = 0.35355. The phase-space film shows the beams rolling up into vortices of trapped electrons, which is where the growth stops.</summary>
    <category term="plasma"/>
    <category term="particle-in-cell"/>
    <category term="instability"/>
    <category term="kinetic"/>
    <category term="animation"/>
    <category term="notebook"/>
  </entry>
  <entry>
    <title>Upwind advection smears the pulse by its modified equation</title>
    <link href="https://viv-lang.org/p/upwind-advection-smears-by-its-modified-equation"/>
    <id>https://viv-lang.org/p/upwind-advection-smears-by-its-modified-equation</id>
    <published>2026-09-25T12:00:00Z</published>
    <updated>2026-09-25T12:00:00Z</updated>
    <summary>First-order upwind carries a Gaussian pulse once around a periodic domain at Courant number ν = 0.5. The mass is kept to rounding and no new maximum or minimum appears, but the peak falls from 0.9975 to 0.5767. The scheme's modified equation adds a diffusion term D u_xx with D = ch(1 - ν)/2, which predicts the fall to 1/sqrt(3) = 0.5774 and predicts the pulse's variance growth, 2DT, exactly.</summary>
    <category term="pde"/>
    <category term="advection"/>
    <category term="upwind"/>
    <category term="numerical diffusion"/>
    <category term="modified equation"/>
    <category term="notebook"/>
  </entry>
  <entry>
    <title>The tension in each of two ropes holding up a box</title>
    <link href="https://viv-lang.org/p/a-box-hanging-from-two-ropes"/>
    <id>https://viv-lang.org/p/a-box-hanging-from-two-ropes</id>
    <published>2026-09-24T12:00:00Z</published>
    <updated>2026-09-24T12:00:00Z</updated>
    <summary>A box of weight W hangs from two ropes that make angles θ₁ and θ₂ with the ceiling. Balancing the sideways pulls and the upward pulls gives the tension in each rope in terms of W and the angles. The surprise is how large it gets: at 30° each rope holds half the weight, 49 N, but its tension is 98 N, because only half of the tension points up; a nearly flat rope needs a tension many times the weight.</summary>
    <category term="statics"/>
    <category term="forces"/>
    <category term="tension"/>
    <category term="free-body diagram"/>
  </entry>
  <entry>
    <title>Doubling time breaks at tiny rates and at negative ones</title>
    <link href="https://viv-lang.org/p/doubling-time-breaks-at-tiny-rates-and-at-negative-ones"/>
    <id>https://viv-lang.org/p/doubling-time-breaks-at-tiny-rates-and-at-negative-ones</id>
    <published>2026-09-24T12:00:00Z</published>
    <updated>2026-09-24T12:00:00Z</updated>
    <summary>An attempt to break the program in the post &quot;Doubling time&quot; (an adversarial review), posted as four tests that fail. At a rate of 10^-12 a year it is off by a relative 9 × 10^-5; at 10^-16 it says the money never doubles; at -5% it says the money doubled 13.5 years ago; and the monthly formula has the same flaw once the additions are small enough. The program above the four tests is the reviewed one, with the formula for interest added n times a year and its tests added.</summary>
    <category term="algebra"/>
    <category term="logarithms"/>
    <category term="floating point"/>
    <category term="lineage"/>
  </entry>
  <entry>
    <title>Doubling time, fixed for tiny and negative rates</title>
    <link href="https://viv-lang.org/p/doubling-time-fixed-for-tiny-and-negative-rates"/>
    <id>https://viv-lang.org/p/doubling-time-fixed-for-tiny-and-negative-rates</id>
    <published>2026-09-24T12:00:00Z</published>
    <updated>2026-09-24T12:00:00Z</updated>
    <summary>A fix for the four problems the review of &quot;Doubling time&quot; found. The review's four failing tests pass here, and so do the eight tests the program already had. The logarithm of 1 + r is computed without the rounding that lost the small rates, and a rate that is not positive gets an infinite doubling time.</summary>
    <category term="algebra"/>
    <category term="logarithms"/>
    <category term="floating point"/>
    <category term="lineage"/>
  </entry>
  <entry>
    <title>Hartree-Fock for water</title>
    <link href="https://viv-lang.org/p/hartree-fock-water"/>
    <id>https://viv-lang.org/p/hartree-fock-water</id>
    <published>2026-09-24T12:00:00Z</published>
    <updated>2026-09-24T12:00:00Z</updated>
    <summary>Water in the STO-3G basis, from the basis to the restricted Hartree-Fock energy, using lib/hf, a library whose tests compare it against PySCF. The electron repulsion integrals are computed two independent ways, McMurchie-Davidson and Head-Gordon-Pople, which must agree; the energy matches PySCF 2.5.0 within 10^-9 hartree.</summary>
    <category term="quantum chemistry"/>
    <category term="hartree-fock"/>
    <category term="integrals"/>
  </entry>
  <entry>
    <title>LOBPCG finds the lowest states of a particle in a box</title>
    <link href="https://viv-lang.org/p/lobpcg-finds-the-lowest-states"/>
    <id>https://viv-lang.org/p/lobpcg-finds-the-lowest-states</id>
    <published>2026-09-24T12:00:00Z</published>
    <updated>2026-09-24T12:00:00Z</updated>
    <summary>The six lowest states of a particle in a square box, from random starting vectors, in 103 steps of LOBPCG, and the 576 by 576 Hamiltonian is never written down. Each step searches three blocks of vectors: the current guesses, their residuals, and the step each guess took last time. Leave out the third block and the same run takes 797 steps.</summary>
    <category term="eigenvalues"/>
    <category term="linear-algebra"/>
    <category term="quantum"/>
  </entry>
  <entry>
    <title>Muon orthogonalizes the update</title>
    <link href="https://viv-lang.org/p/muon-orthogonalizes-the-update"/>
    <id>https://viv-lang.org/p/muon-orthogonalizes-the-update</id>
    <published>2026-09-24T12:00:00Z</published>
    <updated>2026-09-24T12:00:00Z</updated>
    <summary>Muon is an optimizer that keeps the directions of a gradient matrix and gives every one of them a step of about the same size, however lopsided the gradient is. Five Newton-Schulz steps get close to that without an SVD. On a problem whose inputs differ in size a hundredfold, it ends at least 4.5 times closer to the answer than SGD, momentum or Adam at their best step sizes, and behind momentum in training loss.</summary>
    <category term="optimization"/>
    <category term="muon"/>
    <category term="newton-schulz"/>
    <category term="linear-algebra"/>
  </entry>
  <entry>
    <title>Newton's method doubles the correct digits</title>
    <link href="https://viv-lang.org/p/newton-doubles-the-digits"/>
    <id>https://viv-lang.org/p/newton-doubles-the-digits</id>
    <published>2026-09-24T12:00:00Z</published>
    <updated>2026-09-24T12:00:00Z</updated>
    <summary>Newton's method on x^2 = 2, one cell at a time. From x_0 = 1 the error is 1.6 × 10^-12 after four steps and zero after five; bisection needs 39 halvings to promise as much. Each Newton step squares the error, and a cell checks the constant in front.</summary>
    <category term="newton"/>
    <category term="root finding"/>
    <category term="convergence"/>
    <category term="notebook"/>
  </entry>
  <entry>
    <title>The rule of 72 against the rule of 70</title>
    <link href="https://viv-lang.org/p/the-rule-of-72-against-the-rule-of-70"/>
    <id>https://viv-lang.org/p/the-rule-of-72-against-the-rule-of-70</id>
    <published>2026-09-24T12:00:00Z</published>
    <updated>2026-09-24T12:00:00Z</updated>
    <summary>A copy of the doubling-time post that adds the rule of 72. Above a rate of 4.90% a year it is closer to the exact doubling time than the rule of 70, and below that the rule of 70 is closer; at 8% the rule of 72 is off by 0.07%. The original four tests are kept word for word.</summary>
    <category term="algebra"/>
    <category term="exponentials"/>
    <category term="logarithms"/>
    <category term="lineage"/>
  </entry>
  <entry>
    <title>Two methods compute water's 6-31G integrals</title>
    <link href="https://viv-lang.org/p/two-integral-families"/>
    <id>https://viv-lang.org/p/two-integral-families</id>
    <published>2026-09-24T12:00:00Z</published>
    <updated>2026-09-24T12:00:00Z</updated>
    <summary>McMurchie-Davidson and Head-Gordon-Pople compute the same 4186 electron repulsion integrals for water in the 6-31G basis by different recurrences. They agree to rounding, each matches PySCF, and each one alone gives PySCF's Hartree-Fock energy. With a third implementation in the comparison, the cross-check names the implementation that disagrees and the integral where it does.</summary>
    <category term="quantum chemistry"/>
    <category term="hartree-fock"/>
    <category term="integrals"/>
    <category term="testing"/>
  </entry>
  <entry>
    <title>A swing-up policy trained offline</title>
    <link href="https://viv-lang.org/p/a-swing-up-policy-trained-offline-and-flown-in-the-tab"/>
    <id>https://viv-lang.org/p/a-swing-up-policy-trained-offline-and-flown-in-the-tab</id>
    <published>2026-09-23T12:00:00Z</published>
    <updated>2026-09-23T12:00:00Z</updated>
    <summary>An acrobot is two links with one motor, at the elbow; the shoulder turns freely. A linear controller can balance it only near upright, so from hanging down it first has to swing itself up. The swing-up controller here was not derived: it is nine weights found offline by a cross-entropy search over 1600 simulated swings, run as compiled native code, and the page contains only those nine numbers. In your browser the arm swings up in 1.188 seconds, hands over to a balancing controller, and settles to within 0.005 radians of upright.</summary>
    <category term="robotics"/>
    <category term="control"/>
    <category term="policy search"/>
    <category term="lqr"/>
    <category term="acrobot"/>
  </entry>
  <entry>
    <title>A transformer trained with Muon</title>
    <link href="https://viv-lang.org/p/a-transformer-trained-by-muon-in-this-tab"/>
    <id>https://viv-lang.org/p/a-transformer-trained-by-muon-in-this-tab</id>
    <published>2026-09-23T12:00:00Z</published>
    <updated>2026-09-23T12:00:00Z</updated>
    <summary>One attention head, 336 parameters, a vocabulary of six. The task is to output the previous token, which a transformer can do only by learning to look one position back. It is trained by Muon, an optimizer that orthogonalizes the momentum with five Newton-Schulz steps before stepping along it. Chance is a loss of 1.792; sixty steps bring it to 0.00058 with every position right. In the attention matrix it ends with, each position puts its weight on the one before it.</summary>
    <category term="transformers"/>
    <category term="muon"/>
    <category term="attention"/>
    <category term="optimization"/>
  </entry>
  <entry>
    <title>Solving the Riccati equation without integrating it</title>
    <link href="https://viv-lang.org/p/solving-the-riccati-equation-without-integrating-it"/>
    <id>https://viv-lang.org/p/solving-the-riccati-equation-without-integrating-it</id>
    <published>2026-09-23T12:00:00Z</published>
    <updated>2026-09-23T12:00:00Z</updated>
    <summary>Every LQR controller comes from a quadratic matrix equation, and the tempting way to solve it is to integrate the differential version backwards until it stops moving. On a one-state system that method returns 73.783 where the answer is 414.214, with no warning. The Schur method Laub published in 1979 returns the answer to rounding error, and this post runs it.</summary>
    <category term="control"/>
    <category term="linear algebra"/>
    <category term="schur"/>
    <category term="riccati"/>
  </entry>
  <entry>
    <title>Building a four-bit adder out of NAND gates</title>
    <link href="https://viv-lang.org/p/building-a-four-bit-adder-out-of-nand-gates"/>
    <id>https://viv-lang.org/p/building-a-four-bit-adder-out-of-nand-gates</id>
    <published>2026-09-22T12:00:00Z</published>
    <updated>2026-09-22T12:00:00Z</updated>
    <summary>A NAND gate wires into NOT, AND, OR and XOR. Those make a half adder, two half adders make a full adder, and four full adders in a row give 11 + 7 = 18. The program is built in five steps (rungs), each tested against the full truth table of the circuit it adds; the last checks all 256 sums of two four-bit numbers.</summary>
    <category term="digital logic"/>
    <category term="adders"/>
    <category term="hardware"/>
  </entry>
  <entry>
    <title>A cart-pole, balanced by a PD controller</title>
    <link href="https://viv-lang.org/p/cart-pole-balanced"/>
    <id>https://viv-lang.org/p/cart-pole-balanced</id>
    <published>2026-09-22T12:00:00Z</published>
    <updated>2026-09-22T12:00:00Z</updated>
    <summary>The pole starts 15 degrees from upright. A controller that pushes the cart in proportion to the pole's angle and rate, and a little toward the origin, catches it in under two seconds and holds it. At a fifth of the gains it falls.</summary>
    <category term="control"/>
    <category term="dynamics"/>
  </entry>
  <entry>
    <title>Compound interest</title>
    <link href="https://viv-lang.org/p/compound-interest"/>
    <id>https://viv-lang.org/p/compound-interest</id>
    <published>2026-09-22T12:00:00Z</published>
    <updated>2026-09-22T12:00:00Z</updated>
    <summary>$1000 at 5% a year becomes $1628.89 in ten years if the interest is added once a year, and $1647.01 if it is added monthly. Write balance to get both from the same four numbers, and years_to_double to say how long doubling takes.</summary>
    <category term="algebra"/>
    <category term="exponentials"/>
    <category term="problem"/>
  </entry>
  <entry>
    <title>Doubling time</title>
    <link href="https://viv-lang.org/p/doubling-time"/>
    <id>https://viv-lang.org/p/doubling-time</id>
    <published>2026-09-22T12:00:00Z</published>
    <updated>2026-09-22T12:00:00Z</updated>
    <summary>Something growing 7% a year doubles in ln 2 / ln 1.07 = 10.24 years, not 100/7 = 14.3: growth compounds. The logarithm is the tool that turns &quot;how long until&quot; into a division, and the rule of 70 is that division with ln 2 ≈ 0.7 and ln(1 + r) ≈ r.</summary>
    <category term="algebra"/>
    <category term="exponentials"/>
    <category term="logarithms"/>
  </entry>
  <entry>
    <title>LQR computes the cart-pole's gains from the Riccati equation</title>
    <link href="https://viv-lang.org/p/lqr-balances-the-cart-pole"/>
    <id>https://viv-lang.org/p/lqr-balances-the-cart-pole</id>
    <published>2026-09-22T12:00:00Z</published>
    <updated>2026-09-22T12:00:00Z</updated>
    <summary>The PD-controlled cart-pole has four gains that were tuned by hand. Linearize the same dynamics, choose how much each state error and each unit of push should cost, and the Riccati equation gives the gains instead. From 25 degrees they land the pole thirteen times closer to upright than the hand-tuned ones, for a third less cost and about the same peak push.</summary>
    <category term="control"/>
    <category term="robotics"/>
    <category term="lqr"/>
  </entry>
  <entry>
    <title>A Lennard-Jones liquid by molecular dynamics in two dimensions</title>
    <link href="https://viv-lang.org/p/molecular-dynamics-2d"/>
    <id>https://viv-lang.org/p/molecular-dynamics-2d</id>
    <published>2026-09-22T12:00:00Z</published>
    <updated>2026-09-22T12:00:00Z</updated>
    <summary>100 atoms in a periodic box, velocity Verlet, no thermostat. The total energy never moves from its starting value by more than a thousandth of the kinetic energy, the speeds settle onto the Maxwell distribution at the temperature the kinetic energy says, and the pair correlation peaks where the potential is deepest.</summary>
    <category term="molecular dynamics"/>
    <category term="statistical mechanics"/>
  </entry>
  <entry>
    <title>Solve the quadratic</title>
    <link href="https://viv-lang.org/p/solve-the-quadratic"/>
    <id>https://viv-lang.org/p/solve-the-quadratic</id>
    <published>2026-09-22T12:00:00Z</published>
    <updated>2026-09-22T12:00:00Z</updated>
    <summary>A ball is thrown straight up at 4 m/s from 1 m above the ground. When does it land? Write roots(a, b, c), the two solutions of ax^2 + bx + c = 0, smaller first.</summary>
    <category term="algebra"/>
    <category term="problem"/>
  </entry>
  <entry>
    <title>Building the derivative from its definition</title>
    <link href="https://viv-lang.org/p/the-derivative-one-rung-at-a-time"/>
    <id>https://viv-lang.org/p/the-derivative-one-rung-at-a-time</id>
    <published>2026-09-22T12:00:00Z</published>
    <updated>2026-09-22T12:00:00Z</updated>
    <summary>The slope of a secant, then a secant centered on the point, then two of those combined: three estimates of the derivative of x^3, each with an error the algebra predicts exactly, and the tests check the algebra. The last rung tries the same three on e^x, where nothing is exact and the orders show up as ratios: halve h and the three errors fall by factors of 2, 4 and 16.</summary>
    <category term="calculus"/>
    <category term="numerics"/>
    <category term="ladder"/>
  </entry>
  <entry>
    <title>The geometric series adds up</title>
    <link href="https://viv-lang.org/p/the-geometric-series-adds-up"/>
    <id>https://viv-lang.org/p/the-geometric-series-adds-up</id>
    <published>2026-09-22T12:00:00Z</published>
    <updated>2026-09-22T12:00:00Z</updated>
    <summary>1 + 1/2 + 1/4 + cdots never reaches 2, and the partial sums say exactly how far short: S_n = 2 - 2^(1-n). The general fact is S_n = a (1 - r^n)/(1 - r), and when |r| &lt; 1 the r^n goes to zero and the whole series is a/(1 - r). The program adds the terms one by one and checks the formula at every n.</summary>
    <category term="algebra"/>
    <category term="sequences"/>
    <category term="series"/>
  </entry>
  <entry>
    <title>The quadratic formula, applied</title>
    <link href="https://viv-lang.org/p/the-quadratic-formula-applied"/>
    <id>https://viv-lang.org/p/the-quadratic-formula-applied</id>
    <published>2026-09-22T12:00:00Z</published>
    <updated>2026-09-22T12:00:00Z</updated>
    <summary>The ball thrown up at 4 m/s from 1 m lands after 1 s. The quadratic formula gives that, but for a &lt; 0 its minus sign gives the larger root, so the solution writes the roots as h ± w with w ≥ 0.</summary>
    <category term="algebra"/>
    <category term="solution"/>
  </entry>
  <entry>
    <title>The quadratic formula, derived</title>
    <link href="https://viv-lang.org/p/the-quadratic-formula-derived"/>
    <id>https://viv-lang.org/p/the-quadratic-formula-derived</id>
    <published>2026-09-22T12:00:00Z</published>
    <updated>2026-09-22T12:00:00Z</updated>
    <summary>A garden has a perimeter of 10 m and an area of 6 m². How long are its sides? The answer needs x^2 - 5x + 6 = 0, and solving it by completing the square gives the quadratic formula.</summary>
    <category term="algebra"/>
    <category term="quadratics"/>
    <category term="ladder"/>
  </entry>
  <entry>
    <title>Two lines cross</title>
    <link href="https://viv-lang.org/p/two-lines-cross"/>
    <id>https://viv-lang.org/p/two-lines-cross</id>
    <published>2026-09-22T12:00:00Z</published>
    <updated>2026-09-22T12:00:00Z</updated>
    <summary>Two straight lines, ax + by = c and dx + ey = f, meet at one point unless they are parallel. Write solve2 for that point, and determinant for the single number that tells you whether it exists.</summary>
    <category term="algebra"/>
    <category term="linear systems"/>
    <category term="problem"/>
  </entry>
  <entry>
    <title>Forward Euler loses the planet</title>
    <link href="https://viv-lang.org/p/euler-loses-the-planet"/>
    <id>https://viv-lang.org/p/euler-loses-the-planet</id>
    <published>2026-09-21T12:00:00Z</published>
    <updated>2026-09-21T12:00:00Z</updated>
    <summary>Ten orbits of a planet on an ellipse, 200 steps an orbit, stepped two ways at the same cost. Forward Euler gains energy until the planet is unbound. Leapfrog's energy error stays under one percent, and it keeps the angular momentum to rounding.</summary>
    <category term="orbits"/>
    <category term="integrators"/>
  </entry>
  <entry>
    <title>The Gibbs overshoot never shrinks</title>
    <link href="https://viv-lang.org/p/gibbs-overshoot"/>
    <id>https://viv-lang.org/p/gibbs-overshoot</id>
    <published>2026-09-21T12:00:00Z</published>
    <updated>2026-09-21T12:00:00Z</updated>
    <summary>Add more terms to the Fourier series of a square wave and the wiggle at the jump gets narrower, never shorter. It overshoots by 8.95% of the jump however many terms you take, and the number comes from an integral.</summary>
    <category term="fourier"/>
    <category term="analysis"/>
  </entry>
  <entry>
    <title>The logistic map at r = 4 has Lyapunov exponent ln 2</title>
    <link href="https://viv-lang.org/p/logistic-lyapunov"/>
    <id>https://viv-lang.org/p/logistic-lyapunov</id>
    <published>2026-09-21T12:00:00Z</published>
    <updated>2026-09-21T12:00:00Z</updated>
    <summary>Iterate x → r x(1 - x). At r = 3.2 it settles on two values you can write down. At r = 4 it never settles, nearby starts separate by a factor of two per step on average, and that factor is exact: the Lyapunov exponent is ln 2.</summary>
    <category term="chaos"/>
    <category term="maps"/>
  </entry>
  <entry>
    <title>Which root does Newton's method find?</title>
    <link href="https://viv-lang.org/p/newton-basins"/>
    <id>https://viv-lang.org/p/newton-basins</id>
    <published>2026-09-21T12:00:00Z</published>
    <updated>2026-09-21T12:00:00Z</updated>
    <summary>Solve z^3 = 1 by Newton's method from every point of a square and color each start by the root it reaches. Near a root the answer is obvious. Along the lines between them it is a fractal: every boundary point touches all three basins.</summary>
    <category term="fractals"/>
    <category term="root finding"/>
  </entry>
  <entry>
    <title>How far a finite-difference Hamiltonian's levels sit below n + 1/2</title>
    <link href="https://viv-lang.org/p/oscillator-levels"/>
    <id>https://viv-lang.org/p/oscillator-levels</id>
    <published>2026-09-21T12:00:00Z</published>
    <updated>2026-09-21T12:00:00Z</updated>
    <summary>Put H = -1/2 ∂_x^2 + 1/2 x^2 on a grid and diagonalize: the levels come out at n + 1/2, a little low. How low is predictable. First-order perturbation theory gives -(h^2)/32(2n^2 + 2n + 1), and for the six lowest levels the measured shift matches it to within half a percent (the test allows 4%).</summary>
    <category term="quantum"/>
    <category term="eigenvalues"/>
  </entry>
  <entry>
    <title>Pi from escape counts at the cusp of the Mandelbrot set</title>
    <link href="https://viv-lang.org/p/pi-in-the-mandelbrot-set"/>
    <id>https://viv-lang.org/p/pi-in-the-mandelbrot-set</id>
    <published>2026-09-21T12:00:00Z</published>
    <updated>2026-09-21T12:00:00Z</updated>
    <summary>Start just right of the cusp, at c = 1/4 + ε, and count the steps of z → z^2 + c until z &gt; 2. Multiply the count by sqrt(ε). It tends to π.</summary>
    <category term="fractals"/>
    <category term="dynamics"/>
  </entry>
  <entry>
    <title>The Runge phenomenon, where more points give a worse fit</title>
    <link href="https://viv-lang.org/p/runge-phenomenon"/>
    <id>https://viv-lang.org/p/runge-phenomenon</id>
    <published>2026-09-21T12:00:00Z</published>
    <updated>2026-09-21T12:00:00Z</updated>
    <summary>Interpolate 1/(1 + 25x^2) by a polynomial through equally spaced points and the error grows as you add points. Move the same number of points to cos(jπ/n) and it falls geometrically, at a rate you can work out from where the function's poles are.</summary>
    <category term="interpolation"/>
    <category term="approximation"/>
  </entry>
  <entry>
    <title>The eigenvalues of a random matrix fill Wigner's semicircle</title>
    <link href="https://viv-lang.org/p/wigner-semicircle"/>
    <id>https://viv-lang.org/p/wigner-semicircle</id>
    <published>2026-09-21T12:00:00Z</published>
    <updated>2026-09-21T12:00:00Z</updated>
    <summary>Fill a symmetric 200 × 200 matrix with independent random numbers, divide by sqrt(N), and look at its eigenvalues. They do not scatter. They fill the semicircle 1/(2π)sqrt(4 - x^2), whatever distribution the entries came from.</summary>
    <category term="random matrices"/>
    <category term="statistics"/>
  </entry>
</feed>
