PO.FL.QC.Buckley
Description
A second check of a set of equilibrium ratios (K = y/x) at one pressure and temperature: Buckley observed that log K of the components falls close to a straight line against the square of their critical temperature. It needs only the critical temperatures, so it suits a quick look at a separator or flash analysis, beside the Hoffman plot (`PO.FL.QC.Hoffman`). The function returns Tc², log K, the least-squares line and its R², and each component's deviation from the line, so a sheet can draw the plot and flag the component whose analysis is out of line.
Formula
=LAMBDA(k, tc, output, LET(
idx, (output="X")*1+(output="LogK")*2+(output="Slope")*3+(output="Intercept")*4+(output="R2")*5+(output="Dev")*6,
IF(OR(idx=0, ROWS(k)<2, MIN(k)<=0, MIN(tc)<=0), NA(), LET(
xx, tc^2, yy, LOG10(k), nn, ROWS(k), xa, SUM(xx)/nn, ya, SUM(yy)/nn, sxx, SUM((xx-xa)^2), sxy, SUM((xx-xa)*(yy-ya)), syy, SUM((yy-ya)^2), sl, sxy/sxx, ic, ya-sl*xa, CHOOSE(idx, xx, yy, sl, ic, 1-(syy-sxy^2/sxx)/(syy+(syy=0)), yy-ic-sl*xx)))))Parameters
| Parameter | Unit | Description |
|---|---|---|
k |
— | Equilibrium ratio y/x of each component, a column; above 0 |
tc |
°R | Critical temperature of each component, a column; above 0 |
output |
text | "X" Tc² [°R²] (column), "LogK" log10 K (column), "Dev" deviation of log K from the line (column), "Slope" [1/°R²], "Intercept" or "R2" |
Examples
| Invocation | Expected |
|---|---|
=PO.FL.QC.Buckley({40.76601;5.22284;1.17779;0.29732;0.08555;0.02694}, {343;549.6;665.7;765.3;845.4;913.3}, "X") |
[117649, 302060.16, 443156.49, 585684.09, 714701.16, 834116.89] |
=PO.FL.QC.Buckley({40.76601;5.22284;1.17779;0.29732;0.08555;0.02694}, {343;549.6;665.7;765.3;845.4;913.3}, "LogK") |
[1.610298207, 0.7179067216, 0.07106786263, -0.5267758759, -1.067779986, -1.569602409] |
=PO.FL.QC.Buckley({40.76601;5.22284;1.17779;0.29732;0.08555;0.02694}, {343;549.6;665.7;765.3;845.4;913.3}, "Slope") |
-4.413649837E-06 |
=PO.FL.QC.Buckley({40.76601;5.22284;1.17779;0.29732;0.08555;0.02694}, {343;549.6;665.7;765.3;845.4;913.3}, "Intercept") |
2.07740773 |
=PO.FL.QC.Buckley({40.76601;5.22284;1.17779;0.29732;0.08555;0.02694}, {343;549.6;665.7;765.3;845.4;913.3}, "R2") |
0.9988987557 |
=PO.FL.QC.Buckley({40.76601;5.22284;1.17779;0.29732;0.08555;0.02694}, {343;549.6;665.7;765.3;845.4;913.3}, "Dev") |
[0.05215196656, -0.02631323221, -0.0504022972, -0.01917911715, 0.009252942606, 0.0344897374] |
=PO.FL.QC.Buckley({38.6906;5.2285;1.2068;0.3113;0.0915;0.0297}, {343;549.6;665.7;765.3;845.4;913.3}, "R2") |
0.9989636085 |
=IF(ISNA(PO.FL.QC.Buckley({40.76601;5.22284}, {343;549.6}, "Tc")), 1, 0) |
1 |