Invntr
Source

All instruments

gas_eos

Real-gas equations of state (ideal, van der Waals, Redlich-Kwong, Peng-Robinson) from the critical temperature, critical pressure and acentric factor given as inputs: compressibility Z, liquid and vapour molar volumes, fugacity coefficient, second virial coefficient, saturation pressure by equal fugacity, the isotherm and the vapour-pressure curve as csv.

Field
Chemistry
Version
0.1.0
Runs as
Compiled (Rust)
Typical run
0.05 s

Compiled from source: run sh packs/install.sh once before admitting it.

Known answers it must pass

Admission replaygas_eos 0.1.0 · files 4cf4f69e6e0b…f228
  1. r0001ideal gas molar volume R T / P at 273.15 K and 101325 Pa = 22.41396954 L/mol (CODATA 2018, R exact from k_B N_A); closed form, rel 1e-9passed

    molar_volume_L_per_mol22.414 ± 2.2e-0822.414locked22 % of the tolerance used
    Z1 ± 1e-121lockedunder 0.01 % of the tolerance used
  2. r0002van der Waals critical point (Tc 400 K, Pc 4 MPa): Zc = 3/8 exactly, Omega_a = 27/64, Omega_b = 1/8, dP/dV = d2P/dV2 = 0 at (Tc, Vc); Z of the triple root to abs 1e-4 because a triple root carries the cube root of rounding (~5e-6)passed

    Zc0.375 ± 3.8e-130.375lockedunder 0.01 % of the tolerance used
    omega_a0.421875 ± 4.2e-130.421875lockedunder 0.01 % of the tolerance used
    omega_b0.125 ± 1.2e-130.125lockedunder 0.01 % of the tolerance used
    critical_pressure_ratio1 ± 1e-091lockedunder 0.01 % of the tolerance used
    critical_dP_dV_reduced0 ± 1e-09-1.18939e-15lockedunder 0.01 % of the tolerance used
    critical_d2P_dV2_reduced0 ± 1e-096.0759e-15lockedunder 0.01 % of the tolerance used
    Z0.375 ± 0.00010.375002locked1.8 % of the tolerance used
    triple_root_spread0 to 0.00012.75088e-06lockedinside the range
  3. r0003Redlich-Kwong critical point: Zc = 1/3 exactly, Omega_b = (2^(1/3)-1)/3 = 0.08664035, Omega_a = 1/(9(2^(1/3)-1)) = 0.42748023 (Redlich & Kwong 1949 closed forms, rel 1e-6); triple root Z abs 1e-4 (cube-root conditioning)passed

    Zc0.333333 ± 3.3e-130.333333lockedunder 0.01 % of the tolerance used
    omega_b0.0866404 ± 8.7e-080.0866403locked0.04 % of the tolerance used
    omega_a0.42748 ± 4.3e-070.42748locked0.83 % of the tolerance used
    critical_dP_dV_reduced0 ± 1e-09-4.22895e-15lockedunder 0.01 % of the tolerance used
    critical_d2P_dV2_reduced0 ± 1e-091.44021e-14lockedunder 0.01 % of the tolerance used
    Z0.333333 ± 0.00010.333337locked4 % of the tolerance used
    triple_root_spread0 to 0.00013.81471e-06lockedinside the range
  4. r0004Peng-Robinson critical point (Peng & Robinson 1976 textbook values Zc 0.3074, Omega_a 0.45724, Omega_b 0.07780, abs tol half the last printed digit); dP/dV = d2P/dV2 = 0; triple root Z abs 1e-4 (cube-root conditioning)passed

    Zc0.3074 ± 5e-050.307401locked2.6 % of the tolerance used
    omega_a0.45724 ± 5e-060.457236locked89 % of the tolerance used
    omega_b0.0778 ± 5e-060.0777961locked79 % of the tolerance used
    alpha1 ± 1e-121lockedunder 0.01 % of the tolerance used
    critical_dP_dV_reduced0 ± 1e-09-2.92497e-15lockedunder 0.01 % of the tolerance used
    critical_d2P_dV2_reduced0 ± 1e-091.22484e-14lockedunder 0.01 % of the tolerance used
    Z0.307401 ± 0.00010.307404locked3 % of the tolerance used
    triple_root_spread0 to 0.00013.4659e-06lockedinside the range
  5. r0005van der Waals second virial B2 = b - a/(R T) = -(19/64) R Tc/Pc = -2.46835609e-4 m3/mol at T = Tc = 400 K, Pc = 4 MPa (closed form); Z at 1 Pa tends to 1 + B2 P/(R T) = 1 - 7.421875e-8 (abs 1e-12, the next virial term is ~1e-14); B2 from the solved Z at low pressure rel 1e-6 (finite-pressure slope)passed

    second_virial_m3_per_mol-0.000246836 ± 2.5e-13-0.000246836lockedunder 0.01 % of the tolerance used
    second_virial_from_Z_m3_per_mol-0.000246836 ± 2.5e-10-0.000246836locked0.5 % of the tolerance used
    Z1 ± 1e-121locked0.46 % of the tolerance used
  6. r0006van der Waals saturation by equal fugacity against Lekner's exact parametric coexistence (Am. J. Phys. 50, 161, 1982) at y = 1: T = 0.900880331 Tc, P = 0.649705129 Pc, V_L = 0.604476735 Vc, V_V = 2.336827136 Vc (Tc 400 K, Pc 4 MPa); closed form, rel 1e-7passed

    saturation_pressure_Pa2.59882e+06 ± 0.262.59882e+06lockedunder 0.01 % of the tolerance used
    saturation_V_liquid_L_per_mol0.188471 ± 1.9e-080.188471lockedunder 0.01 % of the tolerance used
    saturation_V_vapor_L_per_mol0.728605 ± 7.3e-080.728605lockedunder 0.01 % of the tolerance used
    saturation_ln_phi_gap0 ± 1e-09-5.55112e-16lockedunder 0.01 % of the tolerance used
6 of 6 cases passed · sandbox macos-seatbeltrecorded from the kernel in a fresh lab

Each line is one reading the kernel checked. The bright band is the tolerance; the needle is the value the instrument actually returned when it was admitted. A needle near the centre line used little of its tolerance.

Inputs

NameUnitDefaultMeaning
eos1peng_robinsonEquation of state.
T_KK300.0Temperature.
P_PaPa101325.0Absolute pressure.
Tc_KKCritical temperature of the substance (needed for every eos but ideal).
Pc_PaPaCritical pressure of the substance (needed for every eos but ideal).
omega10.0Acentric factor (Peng-Robinson only).
kappa1Peng-Robinson alpha slope; replaces the 1976 correlation 0.37464 + 1.54226 omega - 0.26992 omega^2 when given.
isotherm_points1200Rows in out/isotherm.csv.

Readings

NameUnitMeaning
eos1
R_J_per_mol_KJ/(mol K)
T_KK
P_PaPa
reduced_temperature1
reduced_pressure1
omega_a1
omega_b1
alpha1
kappa1
a_Pa_m6_per_mol2Pa m^6/mol^2
b_m3_per_molm^3/mol
A1
B1
Z1
phase1
real_root_count1
Z_liquid1
Z_vapor1
molar_volume_m3_per_molm^3/mol
molar_volume_L_per_molL/mol
density_mol_per_m3mol/m^3
V_liquid_L_per_molL/mol
V_vapor_L_per_molL/mol
ln_fugacity_coefficient1
fugacity_coefficient1
fugacity_PaPa
fugacity_coefficient_liquid1
fugacity_coefficient_vapor1
cubic_residual1
triple_root_spread1
second_virial_m3_per_molm^3/mol
second_virial_from_Z_m3_per_molm^3/mol
Zc1
Vc_L_per_molL/mol
critical_pressure_ratio1
critical_dP_dV_reduced1
critical_d2P_dV2_reduced1
saturation_pressure_PaPa
saturation_Z_liquid1
saturation_Z_vapor1
saturation_V_liquid_L_per_molL/mol
saturation_V_vapor_L_per_molL/mol
saturation_fugacity_coefficient1
saturation_ln_phi_gap1
spinodal_min_PaPa
spinodal_max_PaPa
pressure_over_saturation1
isotherm_csv1out/isotherm.csv: V_L_per_mol, P_Pa, Z, P_ideal_Pa, P_coexistence_Pa (Maxwell line inside the two-phase dome).
isotherm_points1
saturation_curve_csv1out/saturation_curve.csv: T_K, T_over_Tc, P_sat_Pa, V_liquid_L_per_mol, V_vapor_L_per_mol from 0.45 Tc to 0.995 Tc.
saturation_curve_points1
all_ok1
warnings1

Try the call

Change a value and the command updates. Nothing runs here; paste it into your terminal or give it to your agent.

Terminal
MCP call