# Scientific model and equations

## 1. System definition

The family models a binary mixture at a single, fixed system pressure:

- **A:** n-hexane, the more volatile component
- **B:** n-heptane, the less volatile component
- `xA`: liquid-phase mole fraction of A
- `yA`: vapour-phase mole fraction of A
- `P`: total pressure, mmHg
- `T`: temperature, °C

The liquid and vapour phases are treated as ideal. The equilibrium calculation uses Raoult's law and Antoine saturation-pressure correlations. The model is intentionally restricted to a binary system without an azeotrope over the displayed range.

## 2. Antoine saturation pressure

For each component i:

\[
\log_{10}\left(P_i^{sat}/\mathrm{mmHg}\right)=A_i-\frac{B_i}{T+C_i}
\]

Coefficients used in the engine:

| Component | A | B | C |
|---|---:|---:|---:|
| n-Hexane | 6.8763 | 1171.53 | 224.0 |
| n-Heptane | 6.89386 | 1264.37 | 216.64 |

The constants are used with temperature in °C and pressure in mmHg. The bubble point is obtained by solving the monotonic pressure-sum equation with bisection:

\[
P=x_A P_A^{sat}(T)+(1-x_A)P_B^{sat}(T)
\]

The equilibrium vapour composition is then:

\[
y_A^*=\frac{x_A P_A^{sat}(T)}{P}
\]

The dew-point helper inverts the equilibrium mapping to obtain the corresponding liquid composition and bubble temperature for a specified vapour composition.

## 3. Continuous column: McCabe–Thiele construction

The continuous column uses constant molar overflow, a total condenser, an equilibrium reboiler convention, and ideal theoretical stages. The distillate and bottoms flow rates follow the overall and component-A material balances:

\[
F=D+B
\]

\[
Fz_F=Dx_D+Bx_B
\]

\[
D=F\frac{z_F-x_B}{x_D-x_B},\qquad B=F-D
\]

For reflux ratio \(R=L_0/D\), the rectifying operating line is:

\[
y=\frac{R}{R+1}x+\frac{x_D}{R+1}
\]

For feed quality q, the q-line is:

\[
y=\frac{q}{q-1}x-\frac{z_F}{q-1}
\]

At q = 1, the feed is treated as saturated liquid and the q-line is vertical at x = zF. The stripping operating line is drawn through the intersection of the rectifying line and q-line and the bottoms point (xB, xB).

The theoretical-stage construction alternates a horizontal equilibrium step and a vertical operating-line step. A finite stage count is returned only when the reflux ratio is above the calculated minimum reflux and the step construction converges before the 100-stage safety bound.

The reported feed stage is the first theoretical contact whose liquid composition enters the stripping section. Stage counts are ideal theoretical contacts; no tray efficiency or packing HETP is applied.

## 4. Minimum reflux

For q = 1, the pinch composition is the feed composition. For other q values, the engine locates the q-line / equilibrium-curve intersection by scanning for a sign change and refining the root by bisection. The rectifying line through the distillate point and the pinch point defines the minimum-reflux slope mmin:

\[
m_{min}=\frac{x_D-y_{pinch}}{x_D-x_{pinch}},\qquad R_{min}=\frac{m_{min}}{1-m_{min}}
\]

A column at or below minimum reflux is marked infeasible for finite-stage calculation.

## 5. Batch distillation: Rayleigh equation

For a well-mixed batch still with negligible holdup and equilibrium vapour leaving the pot:

\[
\ln\left(\frac{F}{W}\right)=\int_{x_W}^{x_F}\frac{dx}{y^*(x)-x}
\]

The integral is evaluated numerically by the composite trapezoidal rule. The remaining still composition xW is found by bisection for a selected distillate recovery D/F. The instantaneous vapour composition is y*(xW). The cumulative average distillate composition follows the component-A material balance:

\[
\bar{x}_D=\frac{Fx_F-Wx_W}{F-W}
\]

This makes the batch experiment mass-conserving by construction, subject to numerical quadrature tolerance.

## 6. Constant relative-volatility approximation in data analysis

The data laboratory creates deterministic synthetic points from the shared Antoine/Raoult model with a small reproducible perturbation. It estimates a single effective alpha from the mean of pointwise log-relative-volatility estimates:

\[
\alpha_i=\frac{y_i(1-x_i)}{x_i(1-y_i)},\qquad \hat\alpha=\exp\left(\frac{1}{N}\sum_i\ln\alpha_i\right)
\]

The fitted constant-alpha curve is:

\[
y=\frac{\hat\alpha x}{1+(\hat\alpha-1)x}
\]

This fit is a compact approximation, not the source of the primary VLE results.

## 7. Energy proxy

The comparison and challenge modules report internal vapour traffic:

\[
V=(R+1)D
\]

This is a comparative operating-load proxy only. It is not a reboiler duty in kW and does not include enthalpy, heat losses, heat integration, pressure drop, or condenser/reboiler efficiency.

## 8. Numerical methods

- Bubble point: 64 bisection iterations.
- Equilibrium inverse: 56 bisection iterations.
- Pinch search for q ≠ 1: 600-point scan followed by 48 bisection iterations.
- Stage stepping: up to 100 theoretical contacts.
- Rayleigh integral: composite trapezoidal quadrature; 120 intervals per root iteration in the batch solver.
- Rayleigh root: 38 bisection iterations.

## 9. Interpretation

Increasing pressure raises the boiling-temperature envelope and changes the VLE curve. Increasing reflux generally reduces theoretical stage count but raises internal liquid and vapour traffic. More stringent product compositions increase separation difficulty. Feed thermal condition changes the q-line and the operating-line intersection. The family is intended to make these relationships inspectable, not to produce construction-ready equipment specifications.
