It is tempting to read the two local minima of an asymmetric double-well curve, where , as the compositions of the two coexisting phases. That reading is wrong: two coexisting phases and reach equilibrium only when both species share identical chemical potentials ( and ), which geometrically requires a common tangent, equivalently, the lower convex hull of all candidate free-energy curves. In this lecture we pair exact regular_solution_binodal bisection with the general monotone-chain convex-hull solver common_tangent_binodal, separate metastable nucleation-and-growth zones from unstable spinodal zones, and construct binary isomorphous liquidus–solidus lenses (isomorphous_phase_boundaries) for Cu–Ni and Ge–Si.
Learning objectives¶
Derive Gibbs’s common-tangent condition from chemical-potential equality , and verify
phase_thermodynamics.regular_solution_binodal.Apply the lower-convex-hull solver
phase_thermodynamics.common_tangent_binodalto both single-curve miscibility gaps and two-phase () crystal equilibria.Distinguish stable single-phase, metastable nucleation-and-growth (, ), and unstable spinodal () fields on a diagram.
Compute Seltz binary isomorphous liquidus and solidus boundaries (
isomorphous_phase_boundaries) for Cu–Ni and Ge–Si and relate lens width to entropy of fusion .
Time: about 60 min
try: # use the installed package, or the copy in this repository
import engmaterials
except ImportError:
import pathlib, subprocess, sys
for _root in [pathlib.Path.cwd(), *pathlib.Path.cwd().parents]:
if (_root / "engmaterials" / "__init__.py").exists():
sys.path.insert(0, str(_root))
break
else: # on Google Colab: install from GitHub
subprocess.run([sys.executable, "-m", "pip", "install", "-q",
"git+https://github.com/ktwyw/engmaterials.git"], check=True)
import engmaterials
import inspect
import numpy as np
import matplotlib.pyplot as plt
from engmaterials import (atomistics, constants, diffraction, elasticity, kinetics_selection,
lattices, phase_field, phase_thermodynamics)
from engmaterials.plotting import label_panels, panel_label, use_style
use_style()
def show_source(obj):
"""Return the source code of a library function or class."""
return inspect.getsource(obj)
def heading(text):
print(f"\n{text}\n" + "=" * len(text))1. Chemical-Potential Equality & Exact Regular-Solution Binodal¶
For two phases at compositions and to coexist in equilibrium at constant , transferring or moles across the interface must produce zero Gibbs energy change ( and ). Recall from Lecture 9 that the tangent line to at has intercept at and at . Two points share both intercepts if and only if they share the same tangent line.
For a symmetric regular solution (), the common tangent is horizontal (), yielding the transcendental binodal equation (phase_thermodynamics.regular_solution_binodal):
heading("Demonstration 1: Exact Regular-Solution Binodal vs Spinodal & Chemical-Potential Equality")
omega_b = 18000.0
Tc_b = phase_thermodynamics.regular_solution_critical_temp(omega_b)
print(f"Omega = {omega_b:.0f} J/mol | Tc = {Tc_b:.2f} K")
print(f"{'T [K]':>7s} | {'x_b1':>9s} | {'x_s1':>9s} | {'x_s2':>9s} | {'x_b2':>9s} | {'|dmu_A1-dmu_A2|':>15s} | {'Metastable Width':>16s}")
print("-" * 94)
for tk in [550.0, 700.0, 850.0, 1000.0]:
xb1, xb2 = phase_thermodynamics.regular_solution_binodal(tk, omega_b)
xs1, xs2 = phase_thermodynamics.regular_solution_spinodal(tk, omega_b)
r1 = phase_thermodynamics.regular_solution_free_energy(xb1, tk, omega_b)
r2 = phase_thermodynamics.regular_solution_free_energy(xb2, tk, omega_b)
dmu_err = max(abs(r1["dmu_A"] - r2["dmu_A"]), abs(r1["dmu_B"] - r2["dmu_B"]))
print(f"{tk:7.1f} | {xb1:9.5f} | {xs1:9.5f} | {xs2:9.5f} | {xb2:9.5f} | {dmu_err:15.2e} | {xs1 - xb1:16.5f}")
assert 0.0 < xb1 < xs1 < 0.5 < xs2 < xb2 < 1.0
assert dmu_err < 1e-8
Demonstration 1: Exact Regular-Solution Binodal vs Spinodal & Chemical-Potential Equality
=========================================================================================
Omega = 18000 J/mol | Tc = 1082.45 K
T [K] | x_b1 | x_s1 | x_s2 | x_b2 | |dmu_A1-dmu_A2| | Metastable Width
----------------------------------------------------------------------------------------------
550.0 | 0.02283 | 0.14932 | 0.85068 | 0.97717 | 2.66e-09 | 0.12649
700.0 | 0.06268 | 0.20280 | 0.79720 | 0.93732 | 1.69e-09 | 0.14012
850.0 | 0.13448 | 0.26830 | 0.73170 | 0.86552 | 5.57e-11 | 0.13382
1000.0 | 0.26836 | 0.36200 | 0.63800 | 0.73164 | 1.68e-10 | 0.09364
What Demonstration 1 shows. At every subcritical temperature , the binodal solvus compositions strictly enclose the spinodal and satisfy . In the metastable collar , the solid solution is locally stable against infinitesimal fluctuations () so phase separation requires overcoming a classical nucleation barrier.
2. General Lower-Convex-Hull Common-Tangent Solver (common_tangent_binodal)¶
When is skewed () or when two distinct crystal structures compete, say FCC with vs. BCC with , the common tangent has a non-zero slope. Because any cord on the lower convex hull of that jumps across a non-convex region or switches phase (phase_left != phase_right) is automatically a global common tangent, Andrew’s monotone-chain algorithm (phase_thermodynamics.common_tangent_binodal) solves single-curve and two-curve equilibria without initial-guess sensitivity.
heading("Demonstration 2: Lower-Convex-Hull Solver on Single-Curve Miscibility Gap & Two-Phase FCC/BCC Equilibrium")
x_hull_grid = np.linspace(0.001, 0.999, 2500)
# Case A: Single-curve regular solution vs exact bisection benchmark at T = 750 K
g_reg_750 = phase_thermodynamics.regular_solution_free_energy(x_hull_grid, 750.0, omega_b)["dG_mix"]
hull_single = phase_thermodynamics.common_tangent_binodal(x_hull_grid, g_reg_750)
tl_s = hull_single["tie_lines"][0]
xb1_ex, xb2_ex = phase_thermodynamics.regular_solution_binodal(750.0, omega_b)
print(f"Single-curve hull tie-line : [{tl_s['x_left']:.5f}, {tl_s['x_right']:.5f}] vs exact [{xb1_ex:.5f}, {xb2_ex:.5f}]")
assert abs(tl_s["x_left"] - xb1_ex) < 6e-4 and abs(tl_s["x_right"] - xb2_ex) < 6e-4
# Case B: Two-phase FCC (alpha, phase 0) vs BCC (beta, phase 1) equilibrium at T = 900 K
# Pure A prefers FCC (0 vs +3500 J/mol); Pure B prefers BCC (+4200 vs 0 J/mol)
rk_a = phase_thermodynamics.redlich_kister_free_energy(x_hull_grid, 900.0, L0=8000.0, L1=-1500.0)
rk_b = phase_thermodynamics.redlich_kister_free_energy(x_hull_grid, 900.0, L0=9500.0, L1=+1200.0)
g_fcc = x_hull_grid * 4200.0 + rk_a["dG_mix"]
g_bcc = (1.0 - x_hull_grid) * 3500.0 + rk_b["dG_mix"]
hull_two = phase_thermodynamics.common_tangent_binodal(x_hull_grid, g_fcc, g_bcc)
tl_ab = hull_two["tie_lines"][0]
print(
f"Two-phase FCC/BCC tie-line : x_FCC = {tl_ab['x_left']:.4f} (phase {tl_ab['phase_left']}) <-> "
f"x_BCC = {tl_ab['x_right']:.4f} (phase {tl_ab['phase_right']}) | slope = {tl_ab['tangent_slope']:+.1f} J/mol"
)
assert tl_ab["phase_left"] == 0 and tl_ab["phase_right"] == 1
assert abs(tl_ab["tangent_slope"]) > 200.0
fig, ax = plt.subplots(figsize=(7.2, 4.1))
ax.plot(x_hull_grid, g_fcc / 1e3, lw=2.0, color="#1f77b4", label=r"FCC $G^\alpha(x)$")
ax.plot(x_hull_grid, g_bcc / 1e3, lw=2.0, color="#ff7f0e", label=r"BCC $G^\beta(x)$")
ax.plot(hull_two["hull_x"], hull_two["hull_g"] / 1e3, "--", lw=1.6, color="black", label="Global Lower Convex Hull")
ax.plot([tl_ab["x_left"], tl_ab["x_right"]], [tl_ab["g_left"] / 1e3, tl_ab["g_right"] / 1e3], "o-", color="#c0392b", lw=2.4, label="Common-Tangent Tie-Line")
ax.set_xlabel(r"Mole Fraction $x_B$ [-]")
ax.set_ylabel(r"Molar Gibbs Energy $G$ [$\mathrm{kJ/mol}$]")
ax.set_title("Two-Phase $\\alpha/\\beta$ Equilibrium via Lower Convex Hull ($T = 900$ K)")
ax.legend(fontsize=8.2)
Demonstration 2: Lower-Convex-Hull Solver on Single-Curve Miscibility Gap & Two-Phase FCC/BCC Equilibrium
=========================================================================================================
Single-curve hull tie-line : [0.08247, 0.91753] vs exact [0.08231, 0.91769]
Two-phase FCC/BCC tie-line : x_FCC = 0.2534 (phase 0) <-> x_BCC = 0.7674 (phase 1) | slope = +261.4 J/mol

Figure 10.1. Gibbs energies of two phases (assumed parameters), their lower convex hull and the common tangent between the two equilibrium compositions.
What Demonstration 2 shows. In Case B, neither nor has a horizontal common tangent: the global convex hull follows single-phase FCC up to , bridges across the two-phase field along a tilted common tangent (slope ) to , and then follows single-phase BCC to .
3. Complete Miscibility-Gap Map & Seltz Isomorphous Phase Diagrams (Cu–Ni & Ge–Si)¶
When both liquid () and solid () behave as ideal solutions across with pure-element melting points and enthalpies of fusion , equating () yields Seltz’s (1934) exact binary isomorphous lens equations (phase_thermodynamics.isomorphous_phase_boundaries):
We plot both the miscibility-gap stability map (binodal vs. spinodal) and the binary isomorphous lenses of Cu–Ni and Ge–Si.
heading("Demonstration 3: T-x Miscibility-Gap Regimes & Cu-Ni / Ge-Si Isomorphous Phase Lenses")
T_mg = np.linspace(400.0, Tc_b - 2.0, 120)
xb_l, xb_r, xs_l, xs_r = [], [], [], []
for tv in T_mg:
b1, b2 = phase_thermodynamics.regular_solution_binodal(tv, omega_b)
s1, s2 = phase_thermodynamics.regular_solution_spinodal(tv, omega_b)
xb_l.append(b1); xb_r.append(b2); xs_l.append(s1); xs_r.append(s2)
# Cu-Ni (FCC metals) and Ge-Si (diamond-cubic semiconductors):
T_CuNi = np.linspace(1357.77, 1728.0, 150)
lens_CuNi = phase_thermodynamics.isomorphous_phase_boundaries(T_CuNi, Tm_A=1357.77, dHm_A=13260.0, Tm_B=1728.0, dHm_B=17480.0)
T_GeSi = np.linspace(1211.4, 1687.0, 150)
lens_GeSi = phase_thermodynamics.isomorphous_phase_boundaries(T_GeSi, Tm_A=1211.4, dHm_A=36940.0, Tm_B=1687.0, dHm_B=50210.0)
max_gap_CuNi = float(np.max(lens_CuNi["x_solidus"] - lens_CuNi["x_liquidus"]))
max_gap_GeSi = float(np.max(lens_GeSi["x_solidus"] - lens_GeSi["x_liquidus"]))
print(f"Cu-Ni isomorphous max two-phase width max(x_S - x_L) = {max_gap_CuNi:.4f}")
print(f"Ge-Si isomorphous max two-phase width max(x_S - x_L) = {max_gap_GeSi:.4f}")
assert np.isclose(lens_CuNi["x_liquidus"][0], 0.0, atol=1e-12) and np.isclose(lens_CuNi["x_solidus"][-1], 1.0, atol=1e-12)
assert np.all(lens_CuNi["x_solidus"][1:-1] > lens_CuNi["x_liquidus"][1:-1])
assert max_gap_GeSi > 2.5 * max_gap_CuNi
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(9.6, 4.1))
ax1.plot(xb_l + xb_r[::-1], list(T_mg) + list(T_mg[::-1]), lw=2.2, color="#1f4e79", label="Binodal (Equilibrium Solvus)")
ax1.plot(xs_l + xs_r[::-1], list(T_mg) + list(T_mg[::-1]), "--", lw=2.0, color="#c0392b", label="Spinodal ($\\partial^2 G / \\partial x^2 = 0$)")
ax1.fill_betweenx(T_mg, xs_l, xs_r, color="#f5b7b1", alpha=0.45, label="Unstable (Spinodal)")
ax1.fill_betweenx(T_mg, xb_l, xs_l, color="#fad7a0", alpha=0.5, label="Metastable (Nucleation)")
ax1.fill_betweenx(T_mg, xs_r, xb_r, color="#fad7a0", alpha=0.5)
ax1.set_xlabel(r"Mole Fraction $x_B$ [-]")
ax1.set_ylabel(r"Temperature $T$ [K]")
ax1.set_title("Solid-State Miscibility Gap & Spinodal")
ax1.legend(fontsize=7.6, loc="lower center")
ax2.plot(lens_CuNi["x_liquidus"], T_CuNi, lw=2.0, color="#1f77b4", label="Cu–Ni Liquidus")
ax2.plot(lens_CuNi["x_solidus"], T_CuNi, "--", lw=2.0, color="#1f77b4", label="Cu–Ni Solidus")
ax2.plot(lens_GeSi["x_liquidus"], T_GeSi, lw=2.0, color="#2ca02c", label="Ge–Si Liquidus")
ax2.plot(lens_GeSi["x_solidus"], T_GeSi, "--", lw=2.0, color="#2ca02c", label="Ge–Si Solidus")
ax2.set_xlabel(r"High-$T_m$ Solute Mole Fraction ($x_{\mathrm{Ni}}$ or $x_{\mathrm{Si}}$) [-]")
ax2.set_ylabel(r"Temperature $T$ [K]")
ax2.set_title("Isomorphous Binary Lenses: Cu–Ni vs. Ge–Si")
ax2.legend(fontsize=8.0)
label_panels(fig)
plt.show()
Demonstration 3: T-x Miscibility-Gap Regimes & Cu-Ni / Ge-Si Isomorphous Phase Lenses
=====================================================================================
Cu-Ni isomorphous max two-phase width max(x_S - x_L) = 0.0718
Ge-Si isomorphous max two-phase width max(x_S - x_L) = 0.2909

Figure 10.2. (a) Binodal and spinodal of a regular solution with the assumed . (b) Liquidus and solidus of Cu–Ni and Ge–Si from the ideal-solution model.
What Demonstration 3 shows. In panel (b), the two-phase lens of Ge–Si () is 4.1 times wider than that of Cu–Ni (), although the two melting points differ by a similar amount in both systems. Section 4 examines the role of Richard’s entropy of fusion in Section 4.
4. Conceptual Exploration & Parameter Sensitivity (“What-If”: Entropy of Fusion )¶
Close-packed metals obey Richard’s rule (), whereas tetrahedrally coordinated semiconductors (Si, Ge) collapse into higher-coordination metallic liquids on melting, releasing a large entropy of fusion (). We fix and while sweeping .
heading("Demonstration 4: Sensitivity of Isomorphous Two-Phase Lens Width to Fusion Entropy dSm / R")
TmA_fix, TmB_fix = 1200.0, 1700.0
T_mid_vec = np.linspace(TmA_fix + 1.0, TmB_fix - 1.0, 400)
dSm_over_R_list = [1.0, 2.0, 3.5, 5.0]
print(f"{'dSm / R':>9s} | {'dHm_A [kJ/mol]':>15s} | {'dHm_B [kJ/mol]':>15s} | {'Max Lens Width (x_S - x_L)':>26s}")
print("-" * 74)
widths = []
for ds_r in dSm_over_R_list:
dHmA = ds_r * constants.R * TmA_fix
dHmB = ds_r * constants.R * TmB_fix
lens = phase_thermodynamics.isomorphous_phase_boundaries(T_mid_vec, TmA_fix, dHmA, TmB_fix, dHmB)
w_max = float(np.max(lens["x_solidus"] - lens["x_liquidus"]))
widths.append(w_max)
print(f"{ds_r:9.2f} | {dHmA/1e3:15.2f} | {dHmB/1e3:15.2f} | {w_max:26.4f}")
assert widths[0] < widths[1] < widths[2] < widths[3]
Demonstration 4: Sensitivity of Isomorphous Two-Phase Lens Width to Fusion Entropy dSm / R
==========================================================================================
dSm / R | dHm_A [kJ/mol] | dHm_B [kJ/mol] | Max Lens Width (x_S - x_L)
--------------------------------------------------------------------------
1.00 | 9.98 | 14.13 | 0.0866
2.00 | 19.95 | 28.27 | 0.1720
3.50 | 34.92 | 49.47 | 0.2949
5.00 | 49.89 | 70.67 | 0.4087
Inside the algorithm¶
In Demonstration 4, increasing the dimensionless entropy of fusion from 1.0 (simple metals) to 5.0 (covalent/molecular crystals) expands the two-phase solidification lens nearly five-fold, from 0.087 to 0.409, directly amplifying compositional partitioning during crystal growth.
Below we inspect phase_thermodynamics.common_tangent_binodal and phase_thermodynamics.isomorphous_phase_boundaries and verify the 2D cross-product convexity test from scratch.
Check against the library¶
heading("Inside the Algorithm: common_tangent_binodal & isomorphous_phase_boundaries")
print(show_source(phase_thermodynamics.common_tangent_binodal))
# Verify Seltz formula at T = 1550 K for Cu-Ni against manual partitioning equations:
T_chk = 1550.0
ca_h = np.exp((13260.0 / constants.R) * (1.0 / T_chk - 1.0 / 1357.77))
cb_h = np.exp((17480.0 / constants.R) * (1.0 / T_chk - 1.0 / 1728.0))
xl_h = (1.0 - ca_h) / (cb_h - ca_h)
xs_h = cb_h * xl_h
iso_lib = phase_thermodynamics.isomorphous_phase_boundaries(T_chk, 1357.77, 13260.0, 1728.0, 17480.0)
assert np.isclose(xl_h, iso_lib["x_liquidus"], rtol=1e-15, atol=1e-15)
assert np.isclose(xs_h, iso_lib["x_solidus"], rtol=1e-15, atol=1e-15)
print(f"Cu-Ni at 1550 K: x_liquidus = {xl_h:.6f}, x_solidus = {xs_h:.6f} (exact match to 1e-15).")
Inside the Algorithm: common_tangent_binodal & isomorphous_phase_boundaries
===========================================================================
def common_tangent_binodal(
x_grid: np.ndarray,
g_alpha: np.ndarray,
g_beta: np.ndarray | None = None,
) -> dict:
"""Construct lower convex hull of one or two Gibbs curves to locate common-tangent two-phase tie-lines."""
xg = np.asarray(x_grid, dtype=float).ravel()
ga = np.asarray(g_alpha, dtype=float).ravel()
if xg.size != ga.size or xg.size < 4:
raise ValueError("x_grid and g_alpha must be 1-D arrays of equal length >= 4.")
if g_beta is None:
pts = [(float(xg[i]), float(ga[i]), 0, i) for i in range(xg.size)]
else:
gb = np.asarray(g_beta, dtype=float).ravel()
if gb.size != xg.size:
raise ValueError("g_beta must match x_grid length.")
pts = [(float(xg[i]), float(ga[i]), 0, i) for i in range(xg.size)] + [
(float(xg[i]), float(gb[i]), 1, i) for i in range(xg.size)
]
pts.sort(key=lambda p: (p[0], p[1]))
hull: list[tuple[float, float, int, int]] = []
for pt in pts:
if hull and abs(hull[-1][0] - pt[0]) < 1e-14:
continue
while len(hull) >= 2:
x1, y1, _, _ = hull[-2]
x2, y2, _, _ = hull[-1]
x3, y3, _, _ = pt
cross = (x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1)
if cross <= 1e-15:
hull.pop()
else:
break
hull.append(pt)
dx_grid = float(np.max(np.diff(np.sort(xg))))
tie_lines = []
for k in range(len(hull) - 1):
p1, p2 = hull[k], hull[k + 1]
is_jump = (p1[2] != p2[2]) or ((p2[0] - p1[0]) > 2.5 * dx_grid)
if is_jump:
slope = (p2[1] - p1[1]) / (p2[0] - p1[0])
intercept = p1[1] - slope * p1[0]
tie_lines.append(
{
"x_left": p1[0],
"x_right": p2[0],
"g_left": p1[1],
"g_right": p2[1],
"phase_left": p1[2],
"phase_right": p2[2],
"tangent_slope": slope,
"mu_A_eq": intercept,
"mu_B_eq": intercept + slope,
}
)
return {
"hull_x": np.array([p[0] for p in hull], dtype=float),
"hull_g": np.array([p[1] for p in hull], dtype=float),
"tie_lines": tie_lines,
}
Cu-Ni at 1550 K: x_liquidus = 0.474797, x_solidus = 0.545992 (exact match to 1e-15).
Exercises¶
Worked solutions are in 10_solutions.ipynb. The cell below the list is a short self-check to start from.
Verify a result. Verify on an asymmetric Redlich–Kister curve () that
common_tangent_binodalyieldsmu_A_eqandmu_B_eqmatching analyticaldmu_A,dmu_Bat both tie-line endpoints, and verify Seltz’s partition identities and across Cu–Ni to 10-14.Find how it fails. Demonstrate the local-minima fallacy on : find the two local minima where , compare them with the true
common_tangent_binodaltie-line, and show that the common tangent yields a strictly lower two-phase Gibbs energy at .Implement it yourself. Implement
hull_isomorphous_tie_line(T_K, Tm_A, dHm_A, Tm_B, dHm_B, n_grid=4000)by constructing and and callingcommon_tangent_binodal(x_grid, G_L, G_S). Verify agreement withisomorphous_phase_boundariesacross 6 Cu–Ni temperatures to< 1e-3.
heading("Self-check for the exercises")
b_pair = phase_thermodynamics.regular_solution_binodal(800.0, 18000.0)
s_pair = phase_thermodynamics.regular_solution_spinodal(800.0, 18000.0)
iso_mid = phase_thermodynamics.isomorphous_phase_boundaries(1550.0, 1357.77, 13260.0, 1728.0, 17480.0)
assert b_pair[0] < s_pair[0] < 0.5 < s_pair[1] < b_pair[1]
assert 0.0 < iso_mid["x_liquidus"] < iso_mid["x_solidus"] < 1.0
print(f"800 K Binodal {np.round(b_pair, 4)} encloses Spinodal {np.round(s_pair, 4)} | Cu-Ni(1550 K): xL={iso_mid['x_liquidus']:.3f}, xS={iso_mid['x_solidus']:.3f}.")
print("All checks passed.")
Self-check for the exercises
============================
800 K Binodal [0.106 0.894] encloses Spinodal [0.2446 0.7554] | Cu-Ni(1550 K): xL=0.475, xS=0.546.
All checks passed.