Dimensional Analysis: Slide the Exponents Until the Dimensions Balance

A target quantity and three ingredients. A dimensional formula is a vector of three exponents over the base dimensions [M][L][T] — multiplying quantities adds those vectors, a power scales them — so demanding that a trial law Q = k X1p X2q X3r have the dimensions of the target is three linear equations in three unknowns, one per base dimension. Three sliders set p, q and r; the ledger draws each row's contributions against its target to a stated, fixed scale and highlights the residual, and the payoff curve plots the trial law against the exact physics over one decade with both normalised at the left edge, which removes the constant k and leaves only the slope. Homogeneous means necessary, not sufficient: one half of m v2 and twice m v2 have identical dimensions. The exponents this sim finds are exact; the constants are not its to give.

A pendulum period from length, gravity and mass. The trial law T = k L^0.50 g^-0.50 m^0.00 has dimensions [M^0.00 L^0.00 T^1.00] against a target of [M^0.00 L^0.00 T^1.00], so all three residuals are zero and the trial is homogeneous. Homogeneous is necessary and not sufficient: the constant k = 6.283 is 2*pi for a small-amplitude pendulum, and dimensions cannot produce it.
dim(Q) = [M^a L^b T^c], a quantity's dimensional formula as the exponent triple (a, b, c) · multiplying quantities adds those vectors, a power scales one · trial = p dim(X1) + q dim(X2) + r dim(X3) for Q = k X1^p X2^q X3^r · residual = trial − target, one per base dimension, and all three zero means homogeneous · homogeneous is necessary and not sufficient: one half of m v^2 and twice m v^2 have identical dimensions, and so does any function of a dimensionless group · k is the constant the exact physics carries and dimensions can never produce it · exponents to two decimals, constants to four significant figures · three base dimensions here because the formula is [M][L][T]; the same elimination runs in seven unchanged, and charge, temperature and amount of substance need the other four
Trial dimensions
[M^0.00 L^0.00 T^1.00]
what k L^p g^q m^r comes to
Homogeneous?
yes
every exponent matches the target - necessary, not sufficient
The law dimensions give
T = k L^0.50 g^-0.50 m^0.00
the exponents are exact; k is not a dimensional result
The constant k
6.283
2*pi for a small-amplitude pendulum - dimensions cannot produce it
Target dimensions [M^0.00 L^0.00 T^1.00]
Residual, M row M 0.00
Residual, L row L 0.00
Residual, T row T 0.00
Derivation, 1 of 8pendulum
Exponent of length L0.50
Exponent of gravity g-0.50
Exponent of mass m0.00