Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

1. Dimensional analysis: the Buckingham Pi theorem and Taylor’s estimate of the Trinity yield

School of Engineering, Nazarbayev University

In 1947 the United States released J. E. Mack’s high-speed film of the Trinity test of 16 July 1945, with the time of each frame and a length scale, while the energy of the explosion remained secret. G. I. Taylor (1950) had worked out the similarity solution of a strong point explosion: the radius RR of the blast wave, the time tt, the energy EE and the density of the air ρ0\rho_0 form a single dimensionless group, Π1=R5ρ0/(Et2)\Pi_1 = R^5 \rho_0 / (E t^2), so that R∝t2/5R \propto t^{2/5}. From the radius–time data of the film he estimated an energy of about 17 kt17\,\mathrm{kt} of TNT; the radiochemical value made public later is about 21 kt21\,\mathrm{kt}. This lecture uses the same reasoning, Mental Move 5, Nondimensionalize Before You Sweep, with exact rational null spaces (representation_scaling.buckingham_pi_nullspace), the dimensional matrices in CANONICAL_DIM_MATRICES and the 25 radius–time pairs of Taylor’s table in TAYLOR_TRINITY_1945.

Learning objectives

  1. Quantify how Buckingham’s Π\Pi-Theorem (p=n−rank⁡(D)p = n - \operatorname{rank}(\mathbf{D})) reduces exponential parameter-sweep grids from GnG^n down to Gn−rG^{n-r} runs across constants_benchmarks.CANONICAL_DIM_MATRICES.

  2. Compute exact primitive-integer dimensional nullspace bases solving Dπ=0\mathbf{D}\boldsymbol{\pi} = \mathbf{0} via representation_scaling.buckingham_pi_nullspace without floating-point SVD basis mixing.

  3. Reproduce G. I. Taylor’s 1950 Trinity blast-wave analysis on constants_benchmarks.TAYLOR_TRINITY_1945, verifying the t2/5t^{2/5} scaling law and extracting explosive yield in kilotons of TNT.

  4. Collapse multi-fluid dimensional experimental scatter onto universal master curves (Eu\mathrm{Eu} vs. Re\mathrm{Re}) and design dynamically similar scale-model tests.

Time: about 60 min

1. Dimensional Homogeneity as Linear Algebra & The Curse of Parameter Sweeps

1.1 The Dimensional Matrix D\mathbf{D} and Rank–Nullity

Every physical law f(q1,q2,…,qn)=0f(q_1, q_2, \dots, q_n) = 0 must hold whether length is measured in metres, centimetres or furlongs (scale-invariance symmetry). If mm base dimensions (such as [M,L,T,Θ][M, L, T, \Theta]) describe each variable’s dimensions as [qj]=∏i=1mDi dij[q_j] = \prod_{i=1}^m D_{i}^{\,d_{ij}}, any dimensionless product Π=∏j=1nqjπj\Pi = \prod_{j=1}^n q_j^{\pi_j} satisfies [Π]=1[\Pi] = 1 if and only if its exponent vector π∈Qn\boldsymbol{\pi} \in \mathbb{Q}^n lies in the right nullspace of the m×nm \times n dimensional matrix D=(dij)\mathbf{D} = (d_{ij}):

D π=0  ⟹  p=dim⁡ker⁡(D)=n−rank⁡(D)(1.1)\mathbf{D}\,\boldsymbol{\pi} = \mathbf{0} \implies p = \dim \ker(\mathbf{D}) = n - \operatorname{rank}(\mathbf{D}) \tag{1.1}

Mental Move #5, Nondimensionalize Before You Sweep: Sweeping G=10G = 10 values per input across n=7n = 7 convective heat-transfer variables (h, D, k, rho, U, mu, cp) executes 107=10,000,00010^7 = 10{,}000{,}000 CFD runs (10n−1=10610^{n-1} = 10^6 independent conditions for the output h). Nondimensionalizing collapses the problem to p=7−4=3p = 7 - 4 = 3 dimensionless groups (Nu=ϕ(Re,Pr)\mathrm{Nu} = \phi(\mathrm{Re}, \mathrm{Pr})), requiring only 10p−1=102=10010^{p-1} = 10^2 = 100 runs, a 10,00010{,}000-fold reduction.


Demonstration 1: Exact rational nullspaces and grid-sweep compression across CANONICAL_DIM_MATRICES
===================================================================================================
Physical System                |  n | rank | p=n-r |  Sweep Gain | Primitive Integer Pi Basis
--------------------------------------------------------------------------------------------------------------
taylor_blast_wave              |  4 |    3 |     1 |     1,000x | R^5 * rho0 / (t^2 * E)
pipe_pressure_drop             |  6 |    3 |     3 |     1,000x | dP_per_L * D / (rho * U^2) ;  dP_per_L * mu / (rho^2 * U^3) ;  dP_per_L * eps_rough / (rho * U^2)
convective_heat_transfer       |  7 |    4 |     3 |    10,000x | k / (h * D) ;  mu / (D * rho * U) ;  rho * U * cp / (h)
capillary_droplet_oscillation  |  5 |    3 |     2 |     1,000x | sigma / (omega^2 * R^3 * rho) ;  mu / (omega * R^2 * rho)

What Demonstration 1 shows.

  • Zero-parameter curves: For taylor_blast_wave (R, t, E, rho0), n=4n = 4 and rank⁡(D)=3  ⟹  p=1\operatorname{rank}(\mathbf{D}) = 3 \implies p = 1 group: Π1=R5ρ0/(t2E)=const\Pi_1 = R^5 \rho_0 / (t^2 E) = \text{const}. Writing S(γ)≡Π11/5S(\gamma) \equiv \Pi_1^{1/5} immediately dictates the exact power-law exponent R(t)=S(γ) (E/ρ0)1/5 t2/5R(t) = S(\gamma)\,(E/\rho_0)^{1/5}\,t^{2/5} from linear algebra alone; solving the equations of gas dynamics is needed only for the constant S(γ)S(\gamma).


2. Taylor’s estimate of the Trinity yield (TAYLOR_TRINITY_1945)

Rearranging Π11/5=R (ρ0/E)1/5 t−2/5=S(γ)\Pi_1^{1/5} = R\,(\rho_0 / E)^{1/5}\,t^{-2/5} = S(\gamma) (where Taylor integrated the self-similar Sedov–Taylor ODE for diatomic air γ=1.4\gamma = 1.4 to obtain S1.4=1.033S_{1.4} = 1.033) gives two predictions for the 25 radius–time pairs measured from Mack’s film (constants_benchmarks.TAYLOR_TRINITY_1945):

  1. Plotting log⁡10R\log_{10} R against log⁡10t\log_{10} t must form a straight line of exact slope 2/5=0.4002/5 = 0.400 across nearly three orders of magnitude in time (0.10 ms0.10\,\mathrm{ms} to 62 ms62\,\mathrm{ms}).

  2. Rescaling every radius measurement into the invariant Ci≡Ri ti−2/5C_i \equiv R_i\,t_i^{-2/5} collapses the entire expanding shock trajectory onto a constant horizontal plateau, from which the classified yield is:

E=ρ0(⟨R t−2/5⟩S(γ))5[J],YTNT=E4.184×1012 J/kt(2.1)E = \rho_0 \left(\frac{\langle R\,t^{-2/5} \rangle}{S(\gamma)}\right)^5 \quad [\mathrm{J}], \qquad Y_{\mathrm{TNT}} = \frac{E}{4.184 \times 10^{12}\ \mathrm{J/kt}} \tag{2.1}

Demonstration 2: Taylor's (1950) estimate of the Trinity energy from 25 frames
==============================================================================
Empirical log-log slope d(log R)/d(log t) : 0.4058  (Exact Buckingham Pi exponent = 2/5 = 0.4000)
Collapsed invariant <R * t^(-2/5)>        : 578.41 m*s^(-2/5) (scatter CV = 5.41% over 620x time span)
Deduced Trinity Energy E                  : 6.880e+13 J  ->  Yield = 16.44 kilotons TNT
<Figure size 1265x462 with 2 Axes>

Figure 1.1. Taylor’s analysis of the Trinity film. (a) Radius of the blast wave against time for the 25 frames, with the law R∝t2/5R \propto t^{2/5} (line); the fitted slope is 0.406. (b) The combination R t−2/5R\,t^{-2/5} is nearly constant after the first frames; its mean plateau, 578.4, corresponds to an energy of 16.4 kt of TNT.

  • Sensitivity to the constant: Because E∝C5E \propto C^5, a 1 % error in C=R t−2/5C = R\,t^{-2/5} is a 5 % error in the energy. Over the 25 frames CC has a coefficient of variation of 5.4 %, the fitted log–log slope is 0.406 against 2/5, and the mean of CC gives 16.4 kt16.4\,\mathrm{kt} of TNT, close to Taylor’s own estimate of about 17 kt17\,\mathrm{kt} and below the radiochemical value of about 21 kt21\,\mathrm{kt}.


3. Collapsing Multi-Fluid Pipe Pressure-Drop Scatter onto One Master Curve

Consider flow in smooth circular pipes, governed by the 5 variables (dP_per_L, rho, U, D, mu), for five fluids: air, water, a light crude oil, a glycerol–water mixture and liquid sodium. The data are synthetic: pressure gradients computed from the laminar law fD=64/Ref_D = 64/\mathrm{Re} blended into the Blasius law fD=0.3164 Re−1/4f_D = 0.3164\,\mathrm{Re}^{-1/4}, with 1.5 % random noise, for representative densities and viscosities. Plotting raw pressure gradient ΔP/L [Pa/m]\Delta P / L\,[\mathrm{Pa/m}] against velocity U [m/s]U\,[\mathrm{m/s}] gives a scattered cloud. Applying buckingham_pi_nullspace yields 5−3=25 - 3 = 2 groups:

Π1=(ΔP/L) DρU2=fD2,Π2=μρUD=1Re(3.1)\Pi_1 = \frac{(\Delta P / L)\,D}{\rho U^2} = \frac{f_D}{2}, \qquad \Pi_2 = \frac{\mu}{\rho U D} = \frac{1}{\mathrm{Re}} \tag{3.1}

All smooth-pipe data for Newtonian fluids must therefore fall on one curve Π1=ϕ(Re)\Pi_1 = \phi(\mathrm{Re}). (The library returns Π1\Pi_1 and Π1Π2\Pi_1\Pi_2 as its basis; any product of powers of the groups is also a group.)


Demonstration 3: Collapsing 5-fluid dimensional scatter onto the universal Moody/Blasius curve
==============================================================================================
Smooth-pipe Pi groups: ['dP_per_L * D / (rho * U^2)', 'dP_per_L * mu / (rho^2 * U^3)']
<Figure size 1265x462 with 2 Axes>
Collapsed 180 multi-fluid points onto 1 curve with RMS scatter = 1.58% (pure measurement noise = 1.50%)

Figure 1.2. Dimensionless collapse of synthetic pipe-flow data. (a) Pressure gradient against mean velocity for five fluids: the points scatter over six decades. (b) The same points as a friction factor against the Reynolds number fall on one curve, laminar below about 2000 and turbulent above.

  • Transfer between fluids: The 180 synthetic points of five fluids fall on one curve with an r.m.s. scatter of 1.58 %, essentially the 1.5 % noise put into the data. A curve measured with water in a laboratory tube therefore predicts the pressure drop of liquid sodium at the same Reynolds number.


4. Dynamic Similitude & Scale-Model Wind-Tunnel Design

Suppose we test a 1:81:8 geometric scale model (Lm/Lp=1/8L_m / L_p = 1/8) of an underwater autonomous hull moving at Up=4.0 m/sU_p = 4.0\,\mathrm{m/s} in seawater (νp=1.05×10−6 m2/s\nu_p = 1.05 \times 10^{-6}\,\mathrm{m^2/s}) inside a pressurized dry-air wind tunnel at 20 bar20\,\mathrm{bar} (ρm=23.8 kg/m3,μm=1.82×10−5 Pa⋅s\rho_m = 23.8\,\mathrm{kg/m^3}, \mu_m = 1.82 \times 10^{-5}\,\mathrm{Pa\cdot s}). Matching Rem=Rep\mathrm{Re}_m = \mathrm{Re}_p and force coefficient CD=F/(12ρU2L2)C_D = F / (\frac{1}{2}\rho U^2 L^2) determines the exact tunnel speed UmU_m and full-scale drag FpF_p.


Demonstration 4: Dynamic similitude scaling (20-bar compressed-air tunnel -> seawater prototype)
================================================================================================
Prototype Re_p = 1.219e+07 | Required 20-bar tunnel speed U_m = 23.31 m/s (Mach = 0.068 < 0.3)
Matched Drag Coefficient C_D = 0.0469 -> Full-scale seawater drag F_p = 3936.2 N
Similitude scaling (why NACA built variable-density compressed-air tunnels) and guards verified

Inside the algorithm

Why does representation_scaling.buckingham_pi_nullspace perform Gaussian elimination over exact fractions.Fraction objects instead of calling np.linalg.svd(D)? We inspect buckingham_pi_nullspace and write manual_svd_vs_rational_pi(dim_matrix) to compare the floating-point SVD nullspace basis against exact rational RREF: SVD rotates the nullspace by arbitrary orthogonal matrices, producing non-integer exponents such as -0.3387, 0.2365 instead of the integers of Nu, Re and Pr, even though both bases span the exact same linear subspace (verified via orthogonal projector equality PSVD=PRREF\mathbf{P}_{\mathrm{SVD}} = \mathbf{P}_{\mathrm{RREF}}).

Check against the library


Inside the algorithm: Exact rational RREF against floating-point SVD nullspace mixing
=====================================================================================
def buckingham_pi_nullspace(dim_matrix: np.ndarray, var_names: list[str] | None = None) -> dict:
    """Compute an exact primitive-integer Buckingham-Pi nullspace basis solving D @ pi = 0 via Fraction RREF."""
    d_in = np.asarray(dim_matrix)
    if d_in.ndim != 2 or d_in.shape[0] == 0 or d_in.shape[1] == 0:
        raise ValueError("dim_matrix must be a non-empty 2-D array of shape (n_dims, n_vars).")
    m_dims, n_vars = d_in.shape
    names = [f"v{j}" for j in range(n_vars)] if var_names is None else list(var_names)
    if len(names) != n_vars:
        raise ValueError("var_names length must equal dim_matrix.shape[1].")

    mat = [[Fraction(val).limit_denominator(10**6) for val in row] for row in d_in.tolist()]
    pivot_cols: list[int] = []
    r_piv = 0
    for col in range(n_vars):
        if r_piv >= m_dims:
            break
        sel = None
        for r in range(r_piv, m_dims):
            if mat[r][col] != 0:
                sel = r
                break
        if sel is None:
            continue
        mat[r_piv], mat[sel] = mat[sel], mat[r_piv]
        pv = mat[r_piv][col]
        mat[r_piv] = [entry / pv for entry in mat[r_piv]]
        for r in range(m_dims):
            if r != r_piv and mat[r][col] != 0:
                fac = mat[r][col]
                mat[r] = [mat[r][c] - fac * mat[r_piv][c] for c in range(n_vars)]
        pivot_cols.append(col)
        r_piv += 1

    rank = len(pivot_cols)
    free_cols = [c for c in range(n_vars) if c not in pivot_cols]
    basis_int: list[list[int]] = []
    formatted: list[str] = []

    for f_col in free_cols:
        vec_q = [Fraction(0) for _ in range(n_vars)]
        vec_q[f_col] = Fraction(1)
        for row_idx, p_col in enumerate(pivot_cols):
            vec_q[p_col] = -mat[row_idx][f_col]

        lcm_den = 1
        for q in vec_q:
            lcm_den = math.lcm(lcm_den, q.denominator)
        ints = [int(q * lcm_den) for q in vec_q]
        nz = [abs(v) for v in ints if v != 0]
        g = nz[0]
        for val in nz[1:]:
            g = math.gcd(g, val)
        ints = [v // g for v in ints]
        if ints[f_col] < 0:
            ints = [-v for v in ints]
        basis_int.append(ints)

        num_terms = [f"{names[j]}^{ints[j]}" if ints[j] != 1 else names[j] for j in range(n_vars) if ints[j] > 0]
        den_terms = [f"{names[j]}^{-ints[j]}" if ints[j] != -1 else names[j] for j in range(n_vars) if ints[j] < 0]
        lhs = " * ".join(num_terms) if num_terms else "1"
        rhs = " * ".join(den_terms)
        formatted.append(f"{lhs} / ({rhs})" if rhs else lhs)

    pi_arr = np.array(basis_int, dtype=int) if basis_int else np.zeros((0, n_vars), dtype=int)
    residual = float(np.max(np.abs(np.asarray(dim_matrix, dtype=float) @ pi_arr.T))) if pi_arr.size else 0.0
    return {
        "rank": rank,
        "n_pi_groups": len(free_cols),
        "pivot_columns": pivot_cols,
        "free_columns": free_cols,
        "pi_exponents": pi_arr,
        "formatted_groups": formatted,
        "nullspace_residual": residual,
    }

Variables: ['h', 'D', 'k', 'rho', 'U', 'mu', 'cp']
SVD Nullspace Row 0 (mixed irrational decimals): [-0.3387  0.2365  0.0433  0.5753  0.5753 -0.2798  0.2954]
Rational RREF Integer Rows:
 [[-1 -1  1  0  0  0  0]
 [ 0 -1  0 -1 -1  1  0]
 [-1  0  0  1  1  0  1]]
Clean Physical Groups: ['k / (h * D)', 'mu / (D * rho * U)', 'rho * U * cp / (h)']
Subspace Projector Max |P_SVD - P_Rational| = 3.05e-16

Exercises

Worked solutions are in 01_solutions.ipynb. The cell below the list is a short self-check to start from.

  1. Verify a result. Use representation_scaling.buckingham_pi_nullspace on (T_period, L, m, g) and CANONICAL_DIM_MATRICES['capillary_droplet_oscillation'], and verify numerical invariance of the capillary Π\Pi-groups across SI, CGS, and Imperial (slug, ft, s) unit systems.

  2. Find how it fails. Audit (a) omitting gravity gg in free-surface ship hull scaling (1:25 tow-tank test of a 150 m150\,\mathrm{m} ship cruising at 10 m/s10\,\mathrm{m/s}), and (b) adding a redundant Force row (Force = M L T^-2) to a 4-variable Hookean spring-mass matrix where naive n−m=0n - m = 0 fails.

  3. Implement it yourself. Implement nondimensional_data_collapse_fitter(dim_matrix, data_columns, target_col=0, var_names=None) that isolates target_col into Πout\Pi_{\mathrm{out}} (exponent +1) by placing repeating basis variables before target_col, computes all input Πk\Pi_k, and fits Πout=C∏kΠkαk\Pi_{\mathrm{out}} = C \prod_k \Pi_k^{\alpha_k} in log space. Test on synthetic multi-fluid convective heat-transfer data governed by Dittus–Boelter Nu=0.023 Re0.80 Pr0.40\mathrm{Nu} = 0.023\,\mathrm{Re}^{0.80}\,\mathrm{Pr}^{0.40}.


Self-check for the exercises
============================
All checks passed.