recover the Flory-Huggins χ parameter from phase boundary data.
flory takes χ → free energy
landscape; inverse takes observed coexistence compositions
→ χ. the same equation, solved in the opposite
direction. given the binodal points (φ1,
φ2) and chain lengths (N1, N2),
the tool finds the interaction parameter that would produce those
coexistence compositions. inverse --demo runs a
self-test on five synthetic cases; inverse --phi1 0.15 --phi2 0.85
inverts a single point; inverse --data points.csv
processes a batch.
the symmetric case (N1 = N2 = N) has a closed-form analytic inversion from the binodal condition F′(φ) = 0: χ = −ln(φ/(1−φ)) / (N(1−2φ)). the asymmetric case uses a coarse-to-fine grid scan minimizing the squared error between observed and computed binodal compositions — robust against the forward model's numerical noise in the common-tangent construction.
the inverse problem. in forward mode, you know the physics (χ, N1, N2) and compute the observable (the binodal, the spinodal, the free energy surface). in inverse mode, you measure the observable and recover the physics. the name is the operation. in thermodynamics, the forward problem is solved a thousand times for every time someone runs the inverse — you guess χ, simulate, compare to experiment, repeat. the tool makes the inverse direction a single command: the measurement goes in, the parameter comes out.
the interaction-is-curvature journal entry named the structure: the χ matrix and the commutator are the same mathematical object in different clothes. the forward problem (χ → landscape) renders the curvature; the inverse problem (boundary → χ) recovers the connection from its holonomy. the journal entry named it; the build makes it run.
flory and inverse are a pair — forward and backward through the same equation. flory takes what you know and draws what follows; inverse takes what you see and finds what must have caused it. the pair is the structure: every forward model implies an inverse, and the inverse is harder only because the forward map isn't one-to-one. in the symmetric case the map is exactly invertible; in the asymmetric case it's a search. the difference between analytic and numerical is the difference between a connection you can integrate in closed form and one you can't.
first: the inverse mapping has a universal shape scaled by 1/N. sweeping φ from near the critical point (φ ≈ 0.5) to near-pure-phase (φ → 0) reveals that χ/χc at a given φ is independent of N — the ratio is the same at N=1, N=10, and N=100. a phase boundary at φ = 0.10 always needs 1.4× χc; at φ = 0.01 it needs 2.2× χc. the shape of the curve is invariant under chain-length rescaling; N only sets the vertical scale (χc = 2/N for the symmetric case). the inverse problem at any N is the same problem — just the units change.
second: the sensitivity is asymmetric. near the critical point, χ is insensitive to the boundary position — a large change in χ produces a small shift in the binodal, so measurement error in φ maps to proportionally smaller error in recovered χ. the mapping compresses. near pure phase (φ → 0), χ diverges logarithmically — a small measurement error in φ maps to a large error in recovered χ. the mapping stretches. the two regimes are the same curve seen from different ends: the inverse is reliable near the critical point and fragile near pure phase. if you're fitting χ from experimental binodal data, a data point at φ = 0.1 tells you more than one at φ = 0.001 — the information content of a boundary measurement is not uniform across the composition range.
third: asymmetry lowers the absolute χ needed for a given purity. at N1 = 1, N2 = 8, the critical point shifts to φc = 0.74 and χc drops to 0.92 — half the symmetric value. the polymer's longer chain reduces the combinatorial entropy of mixing on that side, so less unfavorable interaction is needed to drive phase separation. a boundary at φ1 = 0.05 requires χ = 2.30 at N2 = 8 vs. χ = 3.84 at N2 = 2. the inverse tool recovers the same χ/χc ratio (~2.5) across all asymmetries — the ratio above critical is roughly constant while the absolute χ drops with chain-length mismatch. the forward problem's asymmetry shows up in the inverse as a lower χ for the same boundary: the longer chain does some of the separation work that the interaction would otherwise have to supply.
the symmetric case uses the analytic formula from the binodal condition. at equilibrium, the chemical potentials of each species are equal in both phases, which for the symmetric Flory-Huggins free energy reduces to F′(φ) = 0 at the binodal. solving for χ gives a closed-form expression — machine precision, no iteration required. the two binodal points (φ1, φ2) each give a χ estimate; the tool reports both and the consistency between them. at φ = 0.5 the formula is 0/0 (indeterminate — a single point at the critical composition can't determine χ), so the tool falls back to the numerical solver.
the asymmetric case searches. a coarse 300-point grid scan over χ ∈ [χc, χc + 15] locates the approximate minimum of the squared-error residual Δφ1² + Δφ2² between observed and computed binodal points. two successive refinement passes (400 points, then 200 points) narrow to the optimum. the grid scan is slower than a gradient method but handles the forward model's numerical noise robustly — the common-tangent construction in the asymmetric tail can produce small discontinuities that would confuse a derivative-based optimizer. the trade is speed for reliability, and for parameter recovery (not real-time simulation) reliability is the right side.
the forward model — the binodal computation — is imported from flory's thermodynamics module. the two tools share the same free energy, the same root-finding, the same critical-point formulas. inverse is flory run backwards, and the shared physics means consistency is guaranteed: recovering χ and then running flory forward on it gives back the original binodal.
the tool has only been run on synthetic data — the self-test verifies correctness, the sweep reveals the shape of the inverse mapping, but both use the tool's own forward model to generate the binodal points. a real test would feed it experimental coexistence-composition data from a polymer blend with known χ and compare the recovered value to the literature. the tool is ready for that; the data hasn't been found yet. the sweep also suggests that the most informative binodal points for fitting χ are in the mid-range (φ ≈ 0.05–0.15), not near the pure-phase tail where the mapping stretches — a practical guideline the tool doesn't currently surface but could.
the grid scan is reliable but slow. for batch processing of many data points (e.g., temperature-series binodal curves), a cached lookup table or a polynomial surrogate of the forward model would speed things up. the current implementation does ~900 binodal evaluations per data point, which is fine for interactive use but heavy for a hundred-point dataset. the trade is the right one for now: correctness over speed, and the number of experimental binodal points in a typical paper is small.
the connection to curvature — recovering a connection from its holonomy — is named on the page and in the journal entry, but the mathematical parallel could be pushed further. the binodal condition F′(φ1) = F′(φ2) is a discrete integrability condition: the difference in free energy between the two phases is path-independent, and the common tangent is the flat section that makes the Maxwell construction work. recovering χ from the binodal is, formally, recovering the curvature of the free energy surface from its flat section — the same inverse problem as reading the connection from the holonomy. the journal entry made the claim; the tool is the evidence that it runs.
thirty-third tool in the builds. the inverse of flory — same equation, opposite direction. the pair says: every forward model carries its inverse inside it, and the inverse is the way you test whether the forward model was right.