Sign in

    moonbit-vle

    MoonBit vapor-liquid equilibrium toolkit with Raoult, Henry, Wilson, NRTL and UNIQUAC helpers.

    vle
    lle
    sle
    thermodynamics
    phase-equilibrium
    moonbit
    Download zip
    Author
    Version
    0.2.2
    License
    Apache-2.0
    Last updated
    2 months ago
    Downloads
    36

    No dependencies

    #moonbit-vle

    moonbit-vle is a reusable MoonBit toolkit for vapor–liquid equilibrium (VLE) and adjacent phase-equilibrium calculations. It targets teaching tools, small process-simulation components, property-correlation experiments, and portable WebAssembly/native applications. The library keeps molecular structure processing out of scope: callers provide component and parameter data, and the calculation layer returns reproducible equilibrium results.

    #Core capabilities

    • Antoine, extended Antoine, DIPPR-101, Wagner, and Clausius–Clapeyron vapor-pressure correlations.
    • Raoult-law and Henry-law K values, bubble/dew pressure and temperature calculations.
    • Ideal Rachford–Rice flash and multicomponent activity-coefficient flash with Wilson, NRTL, and UNIQUAC models.
    • Binary and multicomponent activity matrices with dimension and parameter diagnostics.
    • Heat-capacity, latent-heat, liquid/vapor enthalpy, and ideal isenthalpic flash helpers.
    • Binary and multicomponent phase-envelope grids, equilibrium profiles, material balances, Fenske/reflux estimates, and sensitivity analysis.
    • Deterministic Antoine parameter fitting, property catalogs, source-labelled fixtures, benchmark reports, and audit APIs.

    #Quick start

    Add the module to a MoonBit project, or use the repository as a root module:

    moon update moon check --target all moon test --target all

    The public API is designed around normalized compositions and explicit units. Temperatures are kelvin and pressures are bar unless a function name or parameter says otherwise.

    ///|
    test {
    let point = @moonbit-vle.bubble_temperature_k(
    @moonbit-vle.benzene_toluene(),
    [0.45, 0.55],
    1.01325,
    low_k=340.0,
    high_k=390.0,
    )
    inspect(
    point.temperature_k > 360.0 && point.temperature_k < 370.0,
    content="true",
    )
    }

    #CLI demo

    The executable runs a benzene/toluene bubble-point calculation, an ideal activity flash, a material-balance audit, and the pure-pressure benchmark catalog:

    moon run cmd/main --target wasm-gc

    The demo is deterministic, so it can be used as a smoke test in local development or in a release checklist.

    #API examples

    Ideal and non-ideal bubble pressure:

    ///|
    test {
    let components = @moonbit-vle.ethanol_water()
    let ideal = @moonbit-vle.bubble_pressure_bar(components, [0.4, 0.6], 351.15)
    let wilson = @moonbit-vle.bubble_pressure_bar(
    components,
    [0.4, 0.6],
    351.15,
    model=@moonbit-vle.ethanol_water_wilson(),
    )
    inspect(ideal.pressure_bar > 0.0, content="true")
    inspect(wilson.pressure_bar > ideal.pressure_bar, content="true")
    }

    Multicomponent activity flash:

    ///|
    test {
    let matrix = @moonbit-vle.WilsonMatrix::new(
    lambda=[[1.0, 0.8], [1.2, 1.0]],
    source="example parameters",
    )
    let result = @moonbit-vle.flash_isothermal_activity(
    @moonbit-vle.benzene_toluene(),
    [0.5, 0.5],
    370.0,
    1.01325,
    @moonbit-vle.MulticomponentActivityModel::Wilson(matrix),
    )
    inspect(result.converged, content="true")
    }

    #Architecture

    The root package is split by responsibility:

    • types.mbt defines public result records, error constructors, solver options, and provenance-bearing data records.
    • vapor_pressure.mbt, correlations.mbt, and properties.mbt implement property models and checked evaluation.
    • activity_models.mbt, equilibrium.mbt, flash.mbt, and flash_nonideal.mbt implement phase-equilibrium calculations.
    • solvers.mbt, units_composition.mbt, stability.mbt, and validation.mbt provide reusable numerical and input-safety infrastructure.
    • energy.mbt, phase_envelope.mbt, process_calculations.mbt, and distillation_profiles.mbt cover process-calculation workflows.
    • regression.mbt, catalog.mbt, benchmark_report.mbt, matrix_audit.mbt, and sensitivity.mbt support parameter fitting, diagnostics, reproducibility, and review.
    • cmd/main contains the runnable smoke-test demo.

    All public calculations use explicit errors for invalid ranges, dimensions, fractions, and solver failures. Correlation records carry source and range metadata so that callers can choose checked or exploratory evaluation.

    #Benchmarks

    The repository includes rounded, source-labelled pure-property reference points and a benzene/toluene VLE fixture. They are regression fixtures and examples, not a licensed process-design database. Run the deterministic benchmark demo:

    moon run cmd/main --target wasm-gc

    For a detailed explanation of units, tolerances, prediction error, and source handling, see docs/benchmark-methodology.md.

    #Tests and quality checks

    The test suite covers success paths, pure-phase limits, matrix dimensions, correlation ranges, solver bracketing and convergence, material balances, enthalpy paths, parameter fitting, source validation, sensitivity, and malformed inputs. The canonical local checks are:

    moon fmt --check moon check --deny-warn --target all moon build --target all moon test --deny-warn --target all moon test --target native moon info git diff --exit-code

    Coverage can be inspected with:

    moon test --enable-coverage --target native moon coverage report -f summary moon coverage analyze

    #Continuous integration

    GitHub Actions installs the current MoonBit CLI on Linux, macOS, and Windows, then checks formatting, all backends, builds, tests, native tests, coverage, and generated interface files. The publish workflow is manual and performs the same prepublish checks before calling moon publish; credentials are supplied only through repository secrets.

    #Data and limitations

    Built-in Antoine constants are public-reference or educationally rounded records with notes and temperature ranges. Binary interaction parameters are explicitly labelled examples. Replace them with validated data for design work, and preserve the source, units, fitted range, and redistribution rights when adding new records. The current activity flash uses successive substitution; strongly associating, electrolyte, reactive, and high-pressure EOS cases are outside its supported scope.

    #License

    Apache-2.0. See LICENSE.

    VleError

    pub(all) suberror VleError {
    EmptyMixture
    LengthMismatch(expected~ : Int, actual~ : Int)
    InvalidFraction(index~ : Int, value~ : Double)
    NonPositiveTemperature(Double)
    NonPositivePressure(Double)
    MissingBinaryParameter(i~ : Int, j~ : Int)
    SolverDidNotBracket(low~ : Double, high~ : Double)
    SolverDidNotConverge(iterations~ : Int)
    InvalidSolverOptions(String)
    InvalidParameter(String)
    InvalidRange(low~ : Double, high~ : Double)
    } derive(Eq,
    Debug
    )

    ActivityFlashResult

    pub struct ActivityFlashResult {
    temperature_k : Double
    pressure_bar : Double
    vapor_fraction : Double
    liquid : Array[Double]
    vapor : Array[Double]
    k_values : Array[Double]
    iterations : Int
    converged : Bool
    residual : Double
    } derive(
    Debug
    )

    ActivityFlashResult::new

    fn ActivityFlashResult::new(temperature_k~ : Double, pressure_bar~ : Double, vapor_fraction~ : Double, liquid~ : Array[Double], vapor~ : Array[Double], k_values~ : Array[Double], iterations~ : Int, converged~ : Bool, residual~ : Double) -> ActivityFlashResult

    ActivityModel

    pub(all) enum ActivityModel {
    Ideal
    Wilson(WilsonBinary)
    Nrtl(NrtlBinary)
    Uniquac(UniquacBinary)
    } derive(
    Debug
    )

    ActivityModel::ideal

    Antoine

    pub struct Antoine {
    a : Double
    b : Double
    c : Double
    t_min_k : Double
    t_max_k : Double
    note : String
    } derive(
    Debug
    )

    Antoine::is_in_range

    fn Antoine::is_in_range(self : Antoine, temperature_k : Double) -> Bool

    Antoine::new

    fn Antoine::new(a~ : Double, b~ : Double, c~ : Double, t_min_k~ : Double, t_max_k~ : Double, note~ : String) -> Antoine

    Antoine::pressure_bar

    fn Antoine::pressure_bar(self : Antoine, temperature_k : Double) -> Double raise VleError

    Antoine::pressure_bar_checked

    fn Antoine::pressure_bar_checked(self : Antoine, temperature_k : Double) -> Double raise VleError

    AntoineFitResult

    pub struct AntoineFitResult {
    a : Double
    b : Double
    c : Double
    rmse_bar : Double
    max_error_bar : Double
    points : Int
    converged : Bool
    } derive(
    Debug
    )

    AntoineObservation

    pub struct AntoineObservation {
    temperature_k : Double
    pressure_bar : Double
    } derive(
    Debug
    )

    AntoineObservation::new

    fn AntoineObservation::new(temperature_k~ : Double, pressure_bar~ : Double) -> AntoineObservation

    BenchmarkPoint

    pub struct BenchmarkPoint {
    system : String
    temperature_k : Double
    pressure_bar : Double
    liquid : Array[Double]
    vapor : Array[Double]
    source : String
    tolerance : Double
    } derive(
    Debug
    )

    BenchmarkPoint::new

    fn BenchmarkPoint::new(system~ : String, temperature_k~ : Double, pressure_bar~ : Double, liquid~ : Array[Double], vapor~ : Array[Double], source~ : String, tolerance~ : Double) -> BenchmarkPoint raise VleError

    BenchmarkSummary

    pub struct BenchmarkSummary {
    total : Int
    passed : Int
    failed : Int
    pass_rate : Double
    mean_error : Double
    max_error : Double
    } derive(
    Debug
    )

    BinarySplitResult

    pub struct BinarySplitResult {
    feed : Array[Double]
    distillate : Array[Double]
    bottoms : Array[Double]
    distillate_total : Double
    bottoms_total : Double
    component_balance_error : Double
    } derive(
    Debug
    )

    BinarySplitResult::new

    fn BinarySplitResult::new(feed~ : Array[Double], distillate~ : Array[Double], bottoms~ : Array[Double], distillate_total~ : Double, bottoms_total~ : Double, component_balance_error~ : Double) -> BinarySplitResult

    ClausiusClapeyron

    pub struct ClausiusClapeyron {
    reference_pressure_bar : Double
    reference_temperature_k : Double
    enthalpy_vaporization_j_per_mol : Double
    source : String
    } derive(
    Debug
    )

    ClausiusClapeyron::boiling_temperature_k

    fn ClausiusClapeyron::boiling_temperature_k(self : ClausiusClapeyron, pressure_bar : Double, low_k? : Double, high_k? : Double) -> Double raise VleError

    ClausiusClapeyron::is_in_range

    fn ClausiusClapeyron::is_in_range(self : ClausiusClapeyron, temperature_k : Double) -> Bool

    ClausiusClapeyron::new

    fn ClausiusClapeyron::new(reference_pressure_bar~ : Double, reference_temperature_k~ : Double, enthalpy_vaporization_j_per_mol~ : Double, source~ : String) -> ClausiusClapeyron

    ClausiusClapeyron::pressure_bar

    fn ClausiusClapeyron::pressure_bar(self : ClausiusClapeyron, temperature_k : Double) -> Double raise VleError

    ClausiusClapeyron::pressure_change_ratio

    fn ClausiusClapeyron::pressure_change_ratio(self : ClausiusClapeyron, low_temperature_k : Double, high_temperature_k : Double) -> Double raise VleError

    Component

    pub struct Component {
    name : String
    formula : String
    cas : String
    antoine : Antoine
    } derive(
    Debug
    )

    Component::new

    fn Component::new(name~ : String, formula~ : String, cas~ : String, antoine~ : Antoine) -> Component

    Component::saturation_pressure_bar

    fn Component::saturation_pressure_bar(self : Component, temperature_k : Double) -> Double raise VleError

    CorrelationComparison

    pub struct CorrelationComparison {
    name : String
    points : Int
    mean_relative_difference : Double
    maximum_relative_difference : Double
    } derive(
    Debug
    )

    Dippr101

    pub struct Dippr101 {
    a : Double
    b : Double
    c : Double
    d : Double
    e : Double
    t_min_k : Double
    t_max_k : Double
    source : String
    } derive(
    Debug
    )

    Dippr101::new

    fn Dippr101::new(a~ : Double, b~ : Double, c~ : Double, d~ : Double, e~ : Double, t_min_k~ : Double, t_max_k~ : Double, source~ : String) -> Dippr101

    Dippr101::pressure_bar

    fn Dippr101::pressure_bar(self : Dippr101, temperature_k : Double) -> Double raise VleError

    EnergyFlashResult

    pub struct EnergyFlashResult {
    temperature_k : Double
    pressure_bar : Double
    vapor_fraction : Double
    liquid : Array[Double]
    vapor : Array[Double]
    enthalpy_j_per_mol : Double
    iterations : Int
    } derive(
    Debug
    )

    EnergyFlashResult::new

    fn EnergyFlashResult::new(temperature_k~ : Double, pressure_bar~ : Double, vapor_fraction~ : Double, liquid~ : Array[Double], vapor~ : Array[Double], enthalpy_j_per_mol~ : Double, iterations~ : Int) -> EnergyFlashResult

    EquilibriumAudit

    pub struct EquilibriumAudit {
    is_valid : Bool
    maximum_composition_error : Double
    pressure_error : Double
    material_balance_error : Double
    messages : Array[String]
    } derive(
    Debug
    )

    EquilibriumPoint

    pub struct EquilibriumPoint {
    temperature_k : Double
    pressure_bar : Double
    liquid : Array[Double]
    vapor : Array[Double]
    iterations : Int
    } derive(
    Debug
    )

    EquilibriumPoint::new

    fn EquilibriumPoint::new(temperature_k~ : Double, pressure_bar~ : Double, liquid~ : Array[Double], vapor~ : Array[Double], iterations~ : Int) -> EquilibriumPoint

    EquilibriumProfilePoint

    pub struct EquilibriumProfilePoint {
    liquid_fraction : Double
    vapor_fraction : Double
    relative_volatility : Double
    } derive(
    Debug
    )

    ExtendedAntoine

    pub struct ExtendedAntoine {
    a : Double
    b : Double
    c : Double
    d : Double
    e : Double
    t_min_k : Double
    t_max_k : Double
    source : String
    } derive(
    Debug
    )

    ExtendedAntoine::boiling_temperature_k

    fn ExtendedAntoine::boiling_temperature_k(self : ExtendedAntoine, pressure_bar : Double, low_k? : Double, high_k? : Double) -> Double raise VleError

    ExtendedAntoine::is_in_range

    fn ExtendedAntoine::is_in_range(self : ExtendedAntoine, temperature_k : Double) -> Bool

    ExtendedAntoine::new

    fn ExtendedAntoine::new(a~ : Double, b~ : Double, c~ : Double, d~ : Double, e~ : Double, t_min_k~ : Double, t_max_k~ : Double, source~ : String) -> ExtendedAntoine

    ExtendedAntoine::pressure_bar

    fn ExtendedAntoine::pressure_bar(self : ExtendedAntoine, temperature_k : Double) -> Double raise VleError

    ExtendedAntoine::pressure_bar_checked

    fn ExtendedAntoine::pressure_bar_checked(self : ExtendedAntoine, temperature_k : Double) -> Double raise VleError

    FlashResult

    pub struct FlashResult {
    temperature_k : Double
    pressure_bar : Double
    vapor_fraction : Double
    liquid : Array[Double]
    vapor : Array[Double]
    iterations : Int
    } derive(
    Debug
    )

    FlashResult::new

    fn FlashResult::new(temperature_k~ : Double, pressure_bar~ : Double, vapor_fraction~ : Double, liquid~ : Array[Double], vapor~ : Array[Double], iterations~ : Int) -> FlashResult

    GridSpacing

    pub struct GridSpacing {
    count : Int
    minimum : Double
    maximum : Double
    mean : Double
    } derive(
    Debug
    )

    HeatCapacityPolynomial

    pub struct HeatCapacityPolynomial {
    coefficients : Array[Double]
    t_min_k : Double
    t_max_k : Double
    source : String
    } derive(
    Debug
    )

    HeatCapacityPolynomial::derivative

    fn HeatCapacityPolynomial::derivative(self : HeatCapacityPolynomial, temperature_k : Double) -> Double raise VleError

    HeatCapacityPolynomial::evaluate

    fn HeatCapacityPolynomial::evaluate(self : HeatCapacityPolynomial, temperature_k : Double) -> Double raise VleError

    HeatCapacityPolynomial::integral

    fn HeatCapacityPolynomial::integral(self : HeatCapacityPolynomial, low_k~ : Double, high_k~ : Double) -> Double raise VleError

    HeatCapacityPolynomial::is_in_range

    fn HeatCapacityPolynomial::is_in_range(self : HeatCapacityPolynomial, temperature_k : Double) -> Bool

    HeatCapacityPolynomial::new

    fn HeatCapacityPolynomial::new(coefficients~ : Array[Double], t_min_k~ : Double, t_max_k~ : Double, source~ : String) -> HeatCapacityPolynomial raise VleError

    KValueDiagnostics

    pub struct KValueDiagnostics {
    regime : PhaseRegime
    f_at_zero : Double
    f_at_one : Double
    minimum_k : Double
    maximum_k : Double
    stability_margin : Double
    } derive(
    Debug
    )

    MatrixStatistics

    pub struct MatrixStatistics {
    dimension : Int
    minimum : Double
    maximum : Double
    maximum_asymmetry : Double
    diagonal_error : Double
    } derive(
    Debug
    )

    MulticomponentActivityModel

    pub(all) enum MulticomponentActivityModel {
    Ideal
    Wilson(WilsonMatrix)
    Nrtl(NrtlMatrix)
    Uniquac(UniquacMatrix)
    } derive(
    Debug
    )

    NrtlBinary

    pub struct NrtlBinary {
    tau12 : Double
    tau21 : Double
    alpha : Double
    source : String
    } derive(
    Debug
    )

    NrtlBinary::new

    fn NrtlBinary::new(tau12~ : Double, tau21~ : Double, alpha~ : Double, source~ : String) -> NrtlBinary

    NrtlMatrix

    pub struct NrtlMatrix {
    tau : Array[Array[Double]]
    alpha : Array[Array[Double]]
    source : String
    } derive(
    Debug
    )

    NrtlMatrix::new

    fn NrtlMatrix::new(tau~ : Array[Array[Double]], alpha~ : Array[Array[Double]], source~ : String) -> NrtlMatrix

    ParameterRecord

    pub struct ParameterRecord {
    name : String
    value : Double
    unit : String
    lower_bound : Double
    upper_bound : Double
    source : String
    } derive(
    Debug
    )

    ParameterRecord::new

    fn ParameterRecord::new(name~ : String, value~ : Double, unit~ : String, lower_bound~ : Double, upper_bound~ : Double, source~ : String) -> ParameterRecord

    ParameterValidationReport

    pub struct ParameterValidationReport {
    valid : Bool
    issue_count : Int
    checked_count : Int
    messages : Array[String]
    } derive(
    Debug
    )

    PhaseKind

    pub(all) enum PhaseKind {
    Vapor
    Liquid
    Solid
    } derive(Eq,
    Debug
    )

    PhasePoint

    pub struct PhasePoint {
    temperature_k : Double
    pressure_bar : Double
    composition : Array[Double]
    phase : PhaseKind
    } derive(
    Debug
    )

    PhasePoint::new

    fn PhasePoint::new(temperature_k~ : Double, pressure_bar~ : Double, composition~ : Array[Double], phase~ : PhaseKind) -> PhasePoint

    PhaseRegime

    pub(all) enum PhaseRegime {
    SingleLiquid
    TwoPhase
    SingleVapor
    } derive(Eq,
    Debug
    )

    PurePressureBenchmark

    pub struct PurePressureBenchmark {
    component : String
    temperature_k : Double
    pressure_bar : Double
    source : String
    tolerance : Double
    } derive(
    Debug
    )

    PurePressureBenchmark::new

    fn PurePressureBenchmark::new(component~ : String, temperature_k~ : Double, pressure_bar~ : Double, source~ : String, tolerance~ : Double) -> PurePressureBenchmark raise VleError

    ResidualMetrics

    pub struct ResidualMetrics {
    count : Int
    mean_absolute_error : Double
    rmse : Double
    max_abs_error : Double
    max_relative_error : Double
    signed_bias : Double
    } derive(
    Debug
    )

    SensitivityPoint

    pub struct SensitivityPoint {
    temperature_k : Double
    pressure_bar : Double
    derivative_bar_per_k : Double
    relative_sensitivity : Double
    } derive(
    Debug
    )

    ShortcutColumnResult

    pub struct ShortcutColumnResult {
    minimum_stages : Double
    minimum_reflux : Double
    operating_reflux : Double
    estimated_stages : Int
    feed : Array[Double]
    distillate : Array[Double]
    bottoms : Array[Double]
    } derive(
    Debug
    )

    SolidSolubility

    pub struct SolidSolubility {
    component : Component
    solvent : Component
    temperature_k : Double
    mole_fraction : Double
    source : String
    } derive(
    Debug
    )

    SolidSolubility::new

    fn SolidSolubility::new(component~ : Component, solvent~ : Component, temperature_k~ : Double, mole_fraction~ : Double, source~ : String) -> SolidSolubility

    SolverOptions

    pub struct SolverOptions {
    tolerance : Double
    max_iterations : Int
    } derive(
    Debug
    )

    SolverOptions::new

    fn SolverOptions::new(tolerance~ : Double, max_iterations~ : Int) -> SolverOptions raise VleError

    SolverReport

    pub struct SolverReport {
    root : Double
    residual : Double
    iterations : Int
    converged : Bool
    } derive(
    Debug
    )

    SolverReport::new

    fn SolverReport::new(root~ : Double, residual~ : Double, iterations~ : Int, converged~ : Bool) -> SolverReport

    ThermoProperty

    pub struct ThermoProperty {
    component : Component
    molecular_weight_g_per_mol : Double
    liquid_heat_capacity : HeatCapacityPolynomial
    vapor_heat_capacity : HeatCapacityPolynomial
    reference_temperature_k : Double
    normal_boiling_temperature_k : Double
    latent_heat_j_per_mol : Double
    source : String
    } derive(
    Debug
    )

    ThermoProperty::new

    fn ThermoProperty::new(component~ : Component, molecular_weight_g_per_mol~ : Double, liquid_heat_capacity~ : HeatCapacityPolynomial, vapor_heat_capacity~ : HeatCapacityPolynomial, reference_temperature_k~ : Double, normal_boiling_temperature_k~ : Double, latent_heat_j_per_mol~ : Double, source~ : String) -> ThermoProperty raise VleError

    TieLine

    pub struct TieLine {
    temperature_k : Double
    phase_a : Array[Double]
    phase_b : Array[Double]
    source : String
    } derive(
    Debug
    )

    TieLine::new

    fn TieLine::new(temperature_k~ : Double, phase_a~ : Array[Double], phase_b~ : Array[Double], source~ : String) -> TieLine raise VleError

    UniquacBinary

    pub struct UniquacBinary {
    comp1 : UniquacComponent
    comp2 : UniquacComponent
    tau12 : Double
    tau21 : Double
    source : String
    } derive(
    Debug
    )

    UniquacBinary::new

    fn UniquacBinary::new(comp1~ : UniquacComponent, comp2~ : UniquacComponent, tau12~ : Double, tau21~ : Double, source~ : String) -> UniquacBinary

    UniquacComponent

    pub struct UniquacComponent {
    r : Double
    q : Double
    } derive(
    Debug
    )

    UniquacComponent::new

    fn UniquacComponent::new(r~ : Double, q~ : Double) -> UniquacComponent

    UniquacMatrix

    pub struct UniquacMatrix {
    r : Array[Double]
    q : Array[Double]
    tau : Array[Array[Double]]
    source : String
    } derive(
    Debug
    )

    UniquacMatrix::new

    fn UniquacMatrix::new(r~ : Array[Double], q~ : Array[Double], tau~ : Array[Array[Double]], source~ : String) -> UniquacMatrix

    ValidationSummary

    pub struct ValidationSummary {
    valid : Bool
    error_count : Int
    warning_count : Int
    messages : Array[String]
    } derive(
    Debug
    )

    Wagner

    pub struct Wagner {
    a : Double
    b : Double
    c : Double
    d : Double
    critical_temperature_k : Double
    critical_pressure_bar : Double
    t_min_k : Double
    t_max_k : Double
    source : String
    } derive(
    Debug
    )

    Wagner::new

    fn Wagner::new(a~ : Double, b~ : Double, c~ : Double, d~ : Double, critical_temperature_k~ : Double, critical_pressure_bar~ : Double, t_min_k~ : Double, t_max_k~ : Double, source~ : String) -> Wagner

    Wagner::pressure_bar

    fn Wagner::pressure_bar(self : Wagner, temperature_k : Double) -> Double raise VleError

    WilsonBinary

    pub struct WilsonBinary {
    lambda12 : Double
    lambda21 : Double
    source : String
    } derive(
    Debug
    )

    WilsonBinary::new

    fn WilsonBinary::new(lambda12~ : Double, lambda21~ : Double, source~ : String) -> WilsonBinary

    WilsonMatrix

    pub struct WilsonMatrix {
    lambda : Array[Array[Double]]
    source : String
    } derive(
    Debug
    )

    WilsonMatrix::new

    fn WilsonMatrix::new(lambda~ : Array[Array[Double]], source~ : String) -> WilsonMatrix

    acetone

    fn acetone() -> Component

    acetone_chloroform

    fn acetone_chloroform() -> Array[Component]

    acetone_chloroform_nrtl

    fn acetone_chloroform_nrtl() -> ActivityModel

    acetone_thermo_property

    fn acetone_thermo_property() -> ThermoProperty raise VleError

    activity_coefficients

    fn activity_coefficients(model : ActivityModel, liquid : Array[Double], temperature_k : Double) -> Array[Double] raise VleError

    activity_flash_is_two_phase

    fn activity_flash_is_two_phase(result : ActivityFlashResult) -> Bool

    activity_flash_k_error

    fn activity_flash_k_error(result : ActivityFlashResult, components : Array[Component], temperature_k : Double, pressure_bar : Double, model : MulticomponentActivityModel) -> Double raise VleError

    activity_flash_material_balance_error

    fn activity_flash_material_balance_error(result : ActivityFlashResult, feed : Array[Double]) -> Double raise VleError

    activity_flash_phase_fractions

    fn activity_flash_phase_fractions(result : ActivityFlashResult) -> Array[Double]

    activity_flash_residual

    fn activity_flash_residual(result : ActivityFlashResult) -> Double

    antoine_fit_is_reasonable

    fn antoine_fit_is_reasonable(result : AntoineFitResult, max_rmse_bar : Double) -> Bool raise VleError

    antoine_fit_mean_absolute_error

    fn antoine_fit_mean_absolute_error(result : AntoineFitResult, observations : Array[AntoineObservation]) -> Double raise VleError

    antoine_fit_predict_many

    fn antoine_fit_predict_many(result : AntoineFitResult, temperatures_k : Array[Double]) -> Array[Double] raise VleError

    antoine_fit_pressure_bar

    fn antoine_fit_pressure_bar(a : Double, b : Double, c : Double, temperature_k : Double) -> Double raise VleError

    antoine_fit_residuals

    fn antoine_fit_residuals(result : AntoineFitResult, observations : Array[AntoineObservation]) -> Array[Double] raise VleError

    argmax_component

    fn argmax_component(values : Array[Double]) -> Int raise VleError

    argmin_component

    fn argmin_component(values : Array[Double]) -> Int raise VleError

    atm_to_bar

    fn atm_to_bar(pressure_atm : Double) -> Double

    audit_activity_flash

    fn audit_activity_flash(result : ActivityFlashResult, feed : Array[Double]) -> EquilibriumAudit raise VleError

    audit_equilibrium_point

    fn audit_equilibrium_point(point : EquilibriumPoint) -> EquilibriumAudit

    audit_error_budget

    fn audit_error_budget(audit : EquilibriumAudit, tolerance : Double) -> Bool

    audit_flash_result

    fn audit_flash_result(result : FlashResult, feed : Array[Double]) -> EquilibriumAudit raise VleError

    average_heat_capacity

    fn average_heat_capacity(correlation : HeatCapacityPolynomial, low_k~ : Double, high_k~ : Double) -> Double raise VleError

    bar_to_atm

    fn bar_to_atm(pressure_bar : Double) -> Double

    bar_to_kpa

    fn bar_to_kpa(pressure_bar : Double) -> Double

    bar_to_mmhg

    fn bar_to_mmhg(pressure_bar : Double) -> Double

    bar_to_pascal

    fn bar_to_pascal(pressure_bar : Double) -> Double

    benchmark_error_percent

    fn benchmark_error_percent(reference : Double, predicted : Double) -> Double raise VleError

    benchmark_is_within_pressure_tolerance

    fn benchmark_is_within_pressure_tolerance(point : BenchmarkPoint, predicted_pressure_bar : Double) -> Bool

    benchmark_prediction_from_component

    fn benchmark_prediction_from_component(component : Component, point : PurePressureBenchmark) -> Double raise VleError

    benchmark_pressure_error

    fn benchmark_pressure_error(point : BenchmarkPoint, predicted_pressure_bar : Double) -> Double

    benchmark_summary_error_budget

    fn benchmark_summary_error_budget(summary : BenchmarkSummary, maximum_allowed_error : Double) -> Bool raise VleError

    benchmark_summary_is_successful

    fn benchmark_summary_is_successful(summary : BenchmarkSummary, required_pass_rate : Double) -> Bool raise VleError

    benzene

    fn benzene() -> Component

    benzene_thermo_property

    fn benzene_thermo_property() -> ThermoProperty raise VleError

    benzene_toluene

    fn benzene_toluene() -> Array[Component]

    benzene_toluene_benchmarks

    fn benzene_toluene_benchmarks() -> Array[BenchmarkPoint] raise VleError

    benzene_toluene_uniquac

    fn benzene_toluene_uniquac() -> ActivityModel

    benzoic_acid_in_water_demo

    fn benzoic_acid_in_water_demo() -> SolidSolubility

    binary_composition_grid

    fn binary_composition_grid(points : Int) -> Array[Array[Double]] raise VleError

    binary_equilibrium_x

    fn binary_equilibrium_x(vapor_light_fraction : Double, relative_volatility : Double) -> Double raise VleError

    binary_equilibrium_y

    fn binary_equilibrium_y(liquid_light_fraction : Double, relative_volatility : Double) -> Double raise VleError

    blend_compositions

    fn blend_compositions(first : Array[Double], first_amount : Double, second : Array[Double], second_amount : Double) -> Array[Double] raise VleError

    bubble_curve_binary

    fn bubble_curve_binary(components : Array[Component], model : MulticomponentActivityModel, pressure_bar~ : Double, points~ : Int, low_k~ : Double, high_k~ : Double) -> Array[EquilibriumPoint] raise VleError

    bubble_pressure_bar

    fn bubble_pressure_bar(components : Array[Component], liquid : Array[Double], temperature_k : Double, model? : ActivityModel) -> EquilibriumPoint raise VleError

    bubble_pressure_composition_sensitivity

    fn bubble_pressure_composition_sensitivity(components : Array[Component], liquid : Array[Double], temperature_k : Double, fraction_step : Double) -> Array[Double] raise VleError

    bubble_pressure_multicomponent

    fn bubble_pressure_multicomponent(components : Array[Component], liquid : Array[Double], temperature_k : Double, model : MulticomponentActivityModel) -> EquilibriumPoint raise VleError

    bubble_pressure_temperature_sensitivity

    fn bubble_pressure_temperature_sensitivity(components : Array[Component], liquid : Array[Double], temperature_k : Double, step_k : Double, model? : ActivityModel) -> SensitivityPoint raise VleError

    bubble_temperature_k

    fn bubble_temperature_k(components : Array[Component], liquid : Array[Double], pressure_bar : Double, low_k? : Double, high_k? : Double, model? : ActivityModel) -> EquilibriumPoint raise VleError

    bubble_temperature_multicomponent

    fn bubble_temperature_multicomponent(components : Array[Component], liquid : Array[Double], pressure_bar : Double, low_k? : Double, high_k? : Double, model : MulticomponentActivityModel) -> EquilibriumPoint raise VleError

    celsius_to_kelvin

    fn celsius_to_kelvin(temperature_c : Double) -> Double

    chloroform

    fn chloroform() -> Component

    chloroform_thermo_property

    fn chloroform_thermo_property() -> ThermoProperty raise VleError

    classify_phase_regime

    fn classify_phase_regime(k_values : Array[Double], feed : Array[Double]) -> PhaseRegime raise VleError

    combine_independent_uncertainties

    fn combine_independent_uncertainties(uncertainties : Array[Double]) -> Double raise VleError

    combine_streams

    fn combine_streams(first_flows : Array[Double], second_flows : Array[Double]) -> Array[Double] raise VleError

    compare_antoine_to_dippr

    fn compare_antoine_to_dippr(component : Component, dippr : Dippr101, temperatures_k : Array[Double]) -> Double raise VleError

    compare_antoine_to_wagner

    fn compare_antoine_to_wagner(component : Component, wagner : Wagner, temperatures_k : Array[Double]) -> Double raise VleError

    compare_pressure_correlations

    fn compare_pressure_correlations(reference : Component, temperatures_k : Array[Double], correlations : Array[ExtendedAntoine]) -> Array[CorrelationComparison] raise VleError

    component_liquid_enthalpy

    fn component_liquid_enthalpy(property : ThermoProperty, temperature_k : Double) -> Double raise VleError

    component_phase_enthalpy

    fn component_phase_enthalpy(property : ThermoProperty, temperature_k : Double, phase : PhaseKind) -> Double raise VleError

    component_recovery

    fn component_recovery(feed_flow : Double, product_flow : Double) -> Double raise VleError

    component_vapor_enthalpy

    fn component_vapor_enthalpy(property : ThermoProperty, temperature_k : Double) -> Double raise VleError

    componentwise_product

    fn componentwise_product(first : Array[Double], second : Array[Double]) -> Array[Double] raise VleError

    componentwise_quotient

    fn componentwise_quotient(numerator : Array[Double], denominator : Array[Double]) -> Array[Double] raise VleError

    composition_entropy

    fn composition_entropy(composition : Array[Double]) -> Double raise VleError

    composition_is_valid

    fn composition_is_valid(composition : Array[Double], tolerance : Double) -> Bool

    composition_l1_distance

    fn composition_l1_distance(first : Array[Double], second : Array[Double]) -> Double raise VleError

    composition_l2_distance

    fn composition_l2_distance(first : Array[Double], second : Array[Double]) -> Double raise VleError

    composition_maximum

    fn composition_maximum(composition : Array[Double]) -> Double raise VleError

    composition_minimum

    fn composition_minimum(composition : Array[Double]) -> Double raise VleError

    composition_normalization_error

    fn composition_normalization_error(composition : Array[Double]) -> Double

    correlation_maximum_relative_difference

    fn correlation_maximum_relative_difference(reference_pressures_bar : Array[Double], candidate_pressures_bar : Array[Double]) -> Double raise VleError

    correlation_mean_relative_difference

    fn correlation_mean_relative_difference(reference_pressures_bar : Array[Double], candidate_pressures_bar : Array[Double]) -> Double raise VleError

    correlation_relative_difference

    fn correlation_relative_difference(reference_pressure_bar : Double, candidate_pressure_bar : Double) -> Double raise VleError

    curve_compositions_sum_to_one

    fn curve_compositions_sum_to_one(curve : Array[EquilibriumPoint], tolerance : Double) -> Bool raise VleError

    curve_pressure_span

    fn curve_pressure_span(curve : Array[EquilibriumPoint]) -> Double raise VleError

    curve_temperature_span

    fn curve_temperature_span(curve : Array[EquilibriumPoint]) -> Double raise VleError

    cyclohexane

    fn cyclohexane() -> Component

    cyclohexane_thermo_property

    fn cyclohexane_thermo_property() -> ThermoProperty raise VleError

    demo_acetone_chloroform_nrtl

    fn demo_acetone_chloroform_nrtl() -> EquilibriumPoint raise VleError

    demo_benzene_toluene_bubble

    fn demo_benzene_toluene_bubble() -> EquilibriumPoint raise VleError

    demo_benzene_toluene_relative_volatility

    fn demo_benzene_toluene_relative_volatility() -> Double raise VleError

    demo_ethanol_water_wilson

    fn demo_ethanol_water_wilson() -> EquilibriumPoint raise VleError

    dew_curve_binary

    fn dew_curve_binary(components : Array[Component], model : MulticomponentActivityModel, pressure_bar~ : Double, points~ : Int, low_k~ : Double, high_k~ : Double) -> Array[EquilibriumPoint] raise VleError

    dew_pressure_bar

    fn dew_pressure_bar(components : Array[Component], vapor : Array[Double], temperature_k : Double, model? : ActivityModel) -> EquilibriumPoint raise VleError

    dew_pressure_multicomponent

    fn dew_pressure_multicomponent(components : Array[Component], vapor : Array[Double], temperature_k : Double, model : MulticomponentActivityModel) -> EquilibriumPoint raise VleError

    dew_temperature_k

    fn dew_temperature_k(components : Array[Component], vapor : Array[Double], pressure_bar : Double, low_k? : Double, high_k? : Double, model? : ActivityModel) -> EquilibriumPoint raise VleError

    dew_temperature_multicomponent

    fn dew_temperature_multicomponent(components : Array[Component], vapor : Array[Double], pressure_bar : Double, low_k? : Double, high_k? : Double, model : MulticomponentActivityModel) -> EquilibriumPoint raise VleError

    distribution_ratio

    fn distribution_ratio(line : TieLine, component_index : Int) -> Double

    equilibrium_curve_slope

    fn equilibrium_curve_slope(relative_volatility : Double, liquid_fraction : Double) -> Double raise VleError

    equilibrium_point_is_valid

    fn equilibrium_point_is_valid(point : EquilibriumPoint) -> Bool

    estimate_vapor_fraction_from_enthalpy

    fn estimate_vapor_fraction_from_enthalpy(liquid_enthalpy : Double, vapor_enthalpy : Double, target_enthalpy : Double) -> Double raise VleError

    ethanol

    fn ethanol() -> Component

    ethanol_thermo_property

    fn ethanol_thermo_property() -> ThermoProperty raise VleError

    ethanol_water

    fn ethanol_water() -> Array[Component]

    ethanol_water_wilson

    fn ethanol_water_wilson() -> ActivityModel

    ethyl_acetate

    fn ethyl_acetate() -> Component

    ethyl_acetate_thermo_property

    fn ethyl_acetate_thermo_property() -> ThermoProperty raise VleError

    evaluate_pure_pressure_catalog

    fn evaluate_pure_pressure_catalog(components : Array[Component], points : Array[PurePressureBenchmark]) -> BenchmarkSummary raise VleError

    fenske_minimum_stages

    fn fenske_minimum_stages(relative_volatility~ : Double, light_key_distillate_fraction~ : Double, light_key_bottoms_fraction~ : Double) -> Double raise VleError

    finite_difference_condition_number

    fn finite_difference_condition_number(base_value : Double, low_value : Double, high_value : Double, relative_step : Double) -> Double raise VleError

    finite_difference_derivative

    fn finite_difference_derivative(f : (Double) -> Double raise VleError, point : Double, step : Double) -> Double raise VleError

    fit_antoine

    fn fit_antoine(observations : Array[AntoineObservation], initial_c~ : Double, c_span~ : Double, c_steps~ : Int) -> AntoineFitResult raise VleError

    flash_enthalpy_at_temperature

    fn flash_enthalpy_at_temperature(properties : Array[ThermoProperty], feed : Array[Double], temperature_k : Double, pressure_bar : Double) -> Double raise VleError

    flash_isenthalpic_ideal

    fn flash_isenthalpic_ideal(properties : Array[ThermoProperty], feed : Array[Double], feed_temperature_k~ : Double, pressure_bar~ : Double, target_enthalpy_j_per_mol~ : Double, low_k? : Double, high_k? : Double) -> EnergyFlashResult raise VleError

    flash_isothermal_activity

    fn flash_isothermal_activity(components : Array[Component], feed : Array[Double], temperature_k : Double, pressure_bar : Double, model : MulticomponentActivityModel, damping? : Double, tolerance? : Double, max_iterations? : Int) -> ActivityFlashResult raise VleError

    flash_isothermal_ideal

    fn flash_isothermal_ideal(components : Array[Component], feed : Array[Double], temperature_k : Double, pressure_bar : Double) -> FlashResult raise VleError

    forward_difference_derivative

    fn forward_difference_derivative(f : (Double) -> Double raise VleError, point : Double, step : Double) -> Double raise VleError

    generate_equilibrium_profile

    fn generate_equilibrium_profile(relative_volatility~ : Double, points~ : Int) -> Array[EquilibriumProfilePoint] raise VleError

    grid_is_well_formed

    fn grid_is_well_formed(values : Array[Double], minimum_spacing~ : Double) -> Bool

    grid_spacing

    fn grid_spacing(values : Array[Double]) -> GridSpacing

    heat_capacity_change

    fn heat_capacity_change(correlation : HeatCapacityPolynomial, low_k~ : Double, high_k~ : Double) -> Double raise VleError

    henry_k_value

    fn henry_k_value(henry_constant_bar : Double, pressure_bar : Double) -> Double raise VleError

    hexane_cyclohexane_benzene

    fn hexane_cyclohexane_benzene() -> Array[Component]

    integrate_trapezoid

    fn integrate_trapezoid(xs : Array[Double], ys : Array[Double]) -> Double raise VleError

    joule_to_kilojoule

    fn joule_to_kilojoule(energy_j : Double) -> Double

    k_value_diagnostics

    fn k_value_diagnostics(k_values : Array[Double], feed : Array[Double]) -> KValueDiagnostics raise VleError

    k_value_is_near_ideal

    fn k_value_is_near_ideal(k_values : Array[Double], tolerance : Double) -> Bool raise VleError

    k_value_span

    fn k_value_span(k_values : Array[Double]) -> Double raise VleError

    k_value_stability_margin

    fn k_value_stability_margin(k_values : Array[Double], feed : Array[Double]) -> Double raise VleError

    k_value_tangent_plane_proxy

    fn k_value_tangent_plane_proxy(k_values : Array[Double], composition : Array[Double]) -> Double raise VleError

    k_values

    fn k_values(components : Array[Component], temperature_k : Double, pressure_bar : Double) -> Array[Double] raise VleError

    kelvin_to_celsius

    fn kelvin_to_celsius(temperature_k : Double) -> Double

    kilojoule_to_joule

    fn kilojoule_to_joule(energy_kj : Double) -> Double

    kpa_to_bar

    fn kpa_to_bar(pressure_kpa : Double) -> Double

    latent_energy_fraction

    fn latent_energy_fraction(property : ThermoProperty, temperature_k : Double, critical_temperature_k : Double) -> Double raise VleError

    latent_heat_at

    fn latent_heat_at(property : ThermoProperty, temperature_k : Double, critical_temperature_k : Double) -> Double raise VleError

    lever_rule_fraction

    fn lever_rule_fraction(feed : Double, raffinate : Double, extract : Double) -> Double

    linear_interpolate

    fn linear_interpolate(x0 : Double, y0 : Double, x1 : Double, y1 : Double, x : Double) -> Double raise VleError

    liquid_sensible_heat_capacity

    fn liquid_sensible_heat_capacity(property : ThermoProperty, temperature_k : Double) -> Double raise VleError

    mass_flow_to_molar_flow

    fn mass_flow_to_molar_flow(mass_flow_kg_per_s : Double, molecular_weight_g_per_mol : Double) -> Double raise VleError

    mass_to_molar_fractions

    fn mass_to_molar_fractions(mass_fractions : Array[Double], molecular_weights : Array[Double]) -> Array[Double] raise VleError

    material_balance_error

    fn material_balance_error(feed : Array[Double], distillate : Array[Double], bottoms : Array[Double], distillate_total : Double, bottoms_total : Double) -> Double raise VleError

    matrix_add

    fn matrix_add(first : Array[Array[Double]], second : Array[Array[Double]]) -> Array[Array[Double]] raise VleError

    matrix_column_sums

    fn matrix_column_sums(matrix : Array[Array[Double]]) -> Array[Double] raise VleError

    matrix_determinant_2x2

    fn matrix_determinant_2x2(matrix : Array[Array[Double]]) -> Double raise VleError

    matrix_diagonal

    fn matrix_diagonal(matrix : Array[Array[Double]]) -> Array[Double] raise VleError

    matrix_frobenius_norm

    fn matrix_frobenius_norm(matrix : Array[Array[Double]]) -> Double raise VleError

    matrix_identity

    fn matrix_identity(dimension : Int) -> Array[Array[Double]] raise VleError

    matrix_is_symmetric

    fn matrix_is_symmetric(matrix : Array[Array[Double]], tolerance : Double) -> Bool raise VleError

    matrix_quadratic_form

    fn matrix_quadratic_form(matrix : Array[Array[Double]], vector : Array[Double]) -> Double raise VleError

    matrix_row_sums

    fn matrix_row_sums(matrix : Array[Array[Double]]) -> Array[Double] raise VleError

    matrix_scale

    fn matrix_scale(matrix : Array[Array[Double]], scale : Double) -> Array[Array[Double]] raise VleError

    matrix_statistics

    fn matrix_statistics(matrix : Array[Array[Double]]) -> MatrixStatistics raise VleError

    matrix_subtract

    fn matrix_subtract(first : Array[Array[Double]], second : Array[Array[Double]]) -> Array[Array[Double]] raise VleError

    matrix_trace

    fn matrix_trace(matrix : Array[Array[Double]]) -> Double raise VleError

    matrix_transpose

    fn matrix_transpose(matrix : Array[Array[Double]]) -> Array[Array[Double]] raise VleError

    matrix_vector_product

    fn matrix_vector_product(matrix : Array[Array[Double]], vector : Array[Double]) -> Array[Double] raise VleError

    max_abs_value

    fn max_abs_value(values : Array[Double]) -> Double

    maximum_absolute_error

    fn maximum_absolute_error(references : Array[Double], predicted : Array[Double]) -> Double raise VleError

    mean_absolute_error

    fn mean_absolute_error(references : Array[Double], predicted : Array[Double]) -> Double raise VleError

    mean_k_value

    fn mean_k_value(k_values : Array[Double]) -> Double raise VleError

    merge_validation_summaries

    fn merge_validation_summaries(first : ValidationSummary, second : ValidationSummary) -> ValidationSummary

    methanol

    fn methanol() -> Component

    methanol_thermo_property

    fn methanol_thermo_property() -> ThermoProperty raise VleError

    methanol_water

    fn methanol_water() -> Array[Component]

    metrics_summary

    fn metrics_summary(metrics : ResidualMetrics) -> String

    minimum_reflux_ratio_binary

    fn minimum_reflux_ratio_binary(feed_light_fraction~ : Double, distillate_light_fraction~ : Double, relative_volatility~ : Double) -> Double raise VleError

    mixture_energy_gap

    fn mixture_energy_gap(properties : Array[ThermoProperty], composition : Array[Double], temperature_k : Double) -> Double raise VleError

    mixture_liquid_enthalpy

    fn mixture_liquid_enthalpy(properties : Array[ThermoProperty], composition : Array[Double], temperature_k : Double) -> Double raise VleError

    mixture_molecular_weight

    fn mixture_molecular_weight(mole_fractions : Array[Double], molecular_weights : Array[Double]) -> Double raise VleError

    mixture_phase_enthalpy

    fn mixture_phase_enthalpy(properties : Array[ThermoProperty], composition : Array[Double], temperature_k : Double, phase : PhaseKind) -> Double raise VleError

    mixture_vapor_enthalpy

    fn mixture_vapor_enthalpy(properties : Array[ThermoProperty], composition : Array[Double], temperature_k : Double) -> Double raise VleError

    mmhg_to_bar

    fn mmhg_to_bar(pressure_mmhg : Double) -> Double

    molar_flow_to_mass_flow

    fn molar_flow_to_mass_flow(molar_flow_mol_per_s : Double, molecular_weight_g_per_mol : Double) -> Double raise VleError

    molar_to_mass_fractions

    fn molar_to_mass_fractions(mole_fractions : Array[Double], molecular_weights : Array[Double]) -> Array[Double] raise VleError

    mole_fractions_to_partial_pressures

    fn mole_fractions_to_partial_pressures(mole_fractions : Array[Double], pressure_bar : Double) -> Array[Double] raise VleError

    monotonicity_violations

    fn monotonicity_violations(values : Array[Double], increasing~ : Bool) -> Int

    multicomponent_activity_coefficients

    fn multicomponent_activity_coefficients(model : MulticomponentActivityModel, liquid : Array[Double], temperature_k : Double) -> Array[Double] raise VleError

    n_hexane

    fn n_hexane() -> Component

    n_hexane_thermo_property

    fn n_hexane_thermo_property() -> ThermoProperty raise VleError

    normalize

    fn normalize(xs : Array[Double]) -> Array[Double] raise VleError

    normalized_bias

    fn normalized_bias(metrics : ResidualMetrics) -> Double

    normalized_sensitivity

    fn normalized_sensitivity(derivative : Double, value : Double, scale : Double) -> Double raise VleError

    operating_line_gap

    fn operating_line_gap(profile_point : EquilibriumProfilePoint, reflux_ratio : Double, distillate_fraction : Double) -> Double raise VleError

    operating_line_y

    fn operating_line_y(liquid_fraction : Double, reflux_ratio : Double, distillate_fraction : Double) -> Double raise VleError

    parameter_catalog_is_valid

    fn parameter_catalog_is_valid(records : Array[ParameterRecord]) -> Bool

    parameter_catalog_sources

    fn parameter_catalog_sources(records : Array[ParameterRecord]) -> Array[String]

    parameter_catalog_units

    fn parameter_catalog_units(records : Array[ParameterRecord]) -> Array[String]

    parameter_is_near_lower_bound

    fn parameter_is_near_lower_bound(record : ParameterRecord, fraction : Double) -> Bool raise VleError

    parameter_is_near_upper_bound

    fn parameter_is_near_upper_bound(record : ParameterRecord, fraction : Double) -> Bool raise VleError

    parameter_range_width

    fn parameter_range_width(record : ParameterRecord) -> Double

    parameter_record_value

    fn parameter_record_value(records : Array[ParameterRecord], name : String) -> Double raise VleError

    parameter_records_for_component

    fn parameter_records_for_component(component : Component) -> Array[ParameterRecord]

    parameter_records_in_unit

    fn parameter_records_in_unit(records : Array[ParameterRecord], unit : String) -> Array[ParameterRecord]

    parameter_records_with_source

    fn parameter_records_with_source(records : Array[ParameterRecord], source_fragment : String) -> Array[ParameterRecord]

    parameter_relative_position

    fn parameter_relative_position(record : ParameterRecord) -> Double raise VleError

    partial_pressures_to_mole_fractions

    fn partial_pressures_to_mole_fractions(partial_pressures_bar : Array[Double]) -> Array[Double] raise VleError

    pascal_to_bar

    fn pascal_to_bar(pressure_pa : Double) -> Double

    perturb_value

    fn perturb_value(value : Double, relative_change : Double) -> Double raise VleError

    phase_energy_gap

    fn phase_energy_gap(property : ThermoProperty, temperature_k : Double) -> Double raise VleError

    phase_regime_label

    fn phase_regime_label(regime : PhaseRegime) -> String

    phase_split_is_balanced

    fn phase_split_is_balanced(feed : Array[Double], liquid : Array[Double], vapor : Array[Double], vapor_fraction : Double, tolerance : Double) -> Bool raise VleError

    phase_split_residual

    fn phase_split_residual(feed : Array[Double], liquid : Array[Double], vapor : Array[Double], vapor_fraction : Double) -> Double raise VleError

    pressure_catalog_components

    fn pressure_catalog_components() -> Array[Component]

    pressure_catalog_summary

    fn pressure_catalog_summary() -> BenchmarkSummary raise VleError

    pressure_sensitivity_ratio

    fn pressure_sensitivity_ratio(component : Component, low_temperature_k : Double, high_temperature_k : Double, step_k : Double) -> Double raise VleError

    pressure_uncertainty_from_temperature

    fn pressure_uncertainty_from_temperature(sensitivity : SensitivityPoint, temperature_uncertainty_k : Double) -> Double raise VleError

    profile_area

    fn profile_area(profile : Array[EquilibriumProfilePoint]) -> Double raise VleError

    profile_average_gap

    fn profile_average_gap(profile : Array[EquilibriumProfilePoint]) -> Double raise VleError

    profile_gap_integral

    fn profile_gap_integral(profile : Array[EquilibriumProfilePoint], low_fraction : Double, high_fraction : Double) -> Double raise VleError

    profile_interpolate

    fn profile_interpolate(profile : Array[EquilibriumProfilePoint], liquid_fraction : Double) -> Double raise VleError

    profile_is_ordered

    fn profile_is_ordered(profile : Array[EquilibriumProfilePoint]) -> Bool

    profile_maximum_gap

    fn profile_maximum_gap(profile : Array[EquilibriumProfilePoint]) -> Double raise VleError

    profile_minimum_gap

    fn profile_minimum_gap(profile : Array[EquilibriumProfilePoint]) -> Double raise VleError

    profile_operating_line_crossings

    fn profile_operating_line_crossings(profile : Array[EquilibriumProfilePoint], reflux_ratio : Double, distillate_fraction : Double) -> Int raise VleError

    profile_points_above_operating_line

    fn profile_points_above_operating_line(profile : Array[EquilibriumProfilePoint], reflux_ratio : Double, distillate_fraction : Double) -> Int raise VleError

    profile_separation_index

    fn profile_separation_index(profile : Array[EquilibriumProfilePoint]) -> Double raise VleError

    public_parameter_catalog

    fn public_parameter_catalog() -> Array[ParameterRecord]

    public_thermo_property_catalog

    fn public_thermo_property_catalog() -> Array[ThermoProperty] raise VleError

    pure_pressure_benchmarks

    fn pure_pressure_benchmarks() -> Array[PurePressureBenchmark] raise VleError

    q_line_intersection

    fn q_line_intersection(feed_light_fraction : Double, q_value : Double, equilibrium_relative_volatility : Double) -> (Double, Double) raise VleError

    quality_gate

    fn quality_gate(metrics : ResidualMetrics, max_rmse~ : Double, max_relative_error~ : Double) -> Bool

    raoult_k_value

    fn raoult_k_value(component : Component, temperature_k : Double, pressure_bar : Double) -> Double raise VleError

    reconstruct_phase_feed

    fn reconstruct_phase_feed(liquid : Array[Double], vapor : Array[Double], vapor_fraction : Double) -> Array[Double] raise VleError

    relative_error

    fn relative_error(reference : Double, predicted : Double) -> Double raise VleError

    relative_sensitivity_from_perturbation

    fn relative_sensitivity_from_perturbation(base_value : Double, perturbed_value : Double, relative_perturbation : Double) -> Double raise VleError

    relative_volatility

    fn relative_volatility(component_a : Component, component_b : Component, temperature_k : Double) -> Double raise VleError

    residual_metrics

    fn residual_metrics(references : Array[Double], predicted : Array[Double]) -> ResidualMetrics

    residual_vector

    fn residual_vector(references : Array[Double], predicted : Array[Double]) -> Array[Double]

    root_mean_square_error

    fn root_mean_square_error(references : Array[Double], predicted : Array[Double]) -> Double raise VleError

    sample_polynomial

    fn sample_polynomial(correlation : HeatCapacityPolynomial, low_k~ : Double, high_k~ : Double, count~ : Int) -> Array[Double] raise VleError

    saturation_pressure_sensitivity

    fn saturation_pressure_sensitivity(component : Component, temperature_k : Double, step_k : Double) -> SensitivityPoint raise VleError

    saturation_pressures_bar

    fn saturation_pressures_bar(components : Array[Component], temperature_k : Double) -> Array[Double] raise VleError

    scale_composition

    fn scale_composition(composition : Array[Double], scale : Double) -> Array[Double] raise VleError

    sensible_energy_between

    fn sensible_energy_between(property : ThermoProperty, low_temperature_k : Double, high_temperature_k : Double, phase : PhaseKind) -> Double raise VleError

    sensitivity_is_monotone_positive

    fn sensitivity_is_monotone_positive(profile : Array[SensitivityPoint]) -> Bool

    sensitivity_profile_maximum

    fn sensitivity_profile_maximum(profile : Array[SensitivityPoint]) -> SensitivityPoint raise VleError

    sensitivity_profile_mean

    fn sensitivity_profile_mean(profile : Array[SensitivityPoint]) -> Double raise VleError

    shortcut_distillation_binary

    fn shortcut_distillation_binary(feed : Array[Double], relative_volatility~ : Double, light_key_distillate_fraction~ : Double, light_key_bottoms_fraction~ : Double, reflux_multiplier? : Double) -> ShortcutColumnResult raise VleError

    solve_bisection

    fn solve_bisection(low~ : Double, high~ : Double, options~ : SolverOptions, f : (Double) -> Double raise VleError) -> SolverReport raise VleError

    solve_newton

    fn solve_newton(initial~ : Double, low~ : Double, high~ : Double, options~ : SolverOptions, f : (Double) -> Double raise VleError, derivative : (Double) -> Double raise VleError) -> SolverReport raise VleError

    split_binary_stream

    fn split_binary_stream(feed : Array[Double], light_key_recovery~ : Double, heavy_key_recovery~ : Double) -> BinarySplitResult raise VleError

    split_stream_by_fraction

    fn split_stream_by_fraction(flows : Array[Double], first_fraction : Double) -> (Array[Double], Array[Double]) raise VleError

    stream_component_flows

    fn stream_component_flows(composition : Array[Double], total_moles : Double) -> Array[Double] raise VleError

    stream_composition_from_flows

    fn stream_composition_from_flows(flows : Array[Double]) -> Array[Double] raise VleError

    stream_total_moles

    fn stream_total_moles(flows : Array[Double]) -> Double raise VleError

    summarize_pressure_benchmarks

    fn summarize_pressure_benchmarks(points : Array[PurePressureBenchmark], predicted_pressures_bar : Array[Double]) -> BenchmarkSummary raise VleError

    summarize_vle_benchmarks

    fn summarize_vle_benchmarks(points : Array[BenchmarkPoint], predicted_pressures_bar : Array[Double]) -> BenchmarkSummary raise VleError

    symmetric_perturbations

    fn symmetric_perturbations(value : Double, relative_change : Double) -> (Double, Double) raise VleError

    temperature_sensitivity_profile

    fn temperature_sensitivity_profile(component : Component, temperatures_k : Array[Double], step_k : Double) -> Array[SensitivityPoint] raise VleError

    toluene

    fn toluene() -> Component

    toluene_thermo_property

    fn toluene_thermo_property() -> ThermoProperty raise VleError

    validate_array_length

    fn validate_array_length(actual : Int, expected : Int) -> ValidationSummary

    validate_binary_parameters

    fn validate_binary_parameters(first : Double, second : Double, tolerance : Double) -> ValidationSummary

    validate_component_name

    fn validate_component_name(name : String) -> ValidationSummary

    validate_composition_for_model

    fn validate_composition_for_model(composition : Array[Double], expected_dimension : Int) -> ValidationSummary

    validate_correlation_pair

    fn validate_correlation_pair(lower_temperature_k : Double, upper_temperature_k : Double, lower_pressure_bar : Double, upper_pressure_bar : Double) -> ValidationSummary

    validate_k_values

    fn validate_k_values(k_values : Array[Double]) -> Unit raise VleError

    validate_molecular_weights

    fn validate_molecular_weights(weights : Array[Double]) -> Unit raise VleError

    validate_parameter_records

    fn validate_parameter_records(records : Array[ParameterRecord]) -> ParameterValidationReport

    validate_phase_point

    fn validate_phase_point(point : PhasePoint) -> ValidationSummary

    validate_pressure_prediction

    fn validate_pressure_prediction(reference_pressure_bar : Double, predicted_pressure_bar : Double, tolerance_bar : Double) -> ValidationSummary

    validate_pressure_range

    fn validate_pressure_range(pressure_bar : Double, low_bar : Double, high_bar : Double) -> ValidationSummary

    validate_property_catalog

    fn validate_property_catalog(properties : Array[ThermoProperty]) -> ValidationSummary

    validate_solver_options

    fn validate_solver_options(options : SolverOptions) -> ValidationSummary

    validate_source_metadata

    fn validate_source_metadata(source_name : String, source_description : String) -> ValidationSummary

    validate_square_matrix

    fn validate_square_matrix(matrix : Array[Array[Double]], dimension : Int) -> Bool raise VleError

    validate_temperature_delta

    fn validate_temperature_delta(temperature_delta_k : Double, maximum_delta_k : Double) -> ValidationSummary

    validate_temperature_range

    fn validate_temperature_range(temperature_k : Double, low_k : Double, high_k : Double) -> ValidationSummary

    validate_thermo_inputs

    fn validate_thermo_inputs(components~ : Array[Component], composition~ : Array[Double], temperature_k~ : Double, pressure_bar~ : Double) -> ValidationSummary

    validate_thermo_property

    fn validate_thermo_property(property : ThermoProperty) -> ValidationSummary

    validate_unit_name

    fn validate_unit_name(unit : String) -> ValidationSummary

    validation_has_errors

    fn validation_has_errors(summary : ValidationSummary) -> Bool

    validation_has_warning

    fn validation_has_warning(summary : ValidationSummary) -> Bool

    validation_is_strict

    fn validation_is_strict(summary : ValidationSummary) -> Bool

    validation_message_count

    fn validation_message_count(summary : ValidationSummary) -> Int

    validation_risk_score

    fn validation_risk_score(summary : ValidationSummary) -> Double

    validation_score_passes

    fn validation_score_passes(summary : ValidationSummary, maximum_score : Double) -> Bool

    validation_summary_is_empty

    fn validation_summary_is_empty(summary : ValidationSummary) -> Bool

    van_t_hoff_solid_solubility

    fn van_t_hoff_solid_solubility(melting_temperature_k~ : Double, fusion_enthalpy_j_per_mol~ : Double, temperature_k~ : Double) -> Double raise VleError

    vapor_sensible_heat_capacity

    fn vapor_sensible_heat_capacity(property : ThermoProperty, temperature_k : Double) -> Double raise VleError

    vector_distance

    fn vector_distance(a : Array[Double], b : Array[Double]) -> Double raise VleError

    water

    fn water() -> Component

    water_thermo_property

    fn water_thermo_property() -> ThermoProperty raise VleError

    watson_latent_heat

    fn watson_latent_heat(reference_latent_heat_j_per_mol~ : Double, reference_temperature_k~ : Double, critical_temperature_k~ : Double, temperature_k~ : Double) -> Double raise VleError

    watt_to_joule_per_second

    fn watt_to_joule_per_second(power_w : Double) -> Double

    watts_per_mol_to_joules_per_mol

    fn watts_per_mol_to_joules_per_mol(value : Double) -> Double

    weighted_average

    fn weighted_average(values : Array[Double], weights : Array[Double]) -> Double raise VleError

    weighted_phase_enthalpy

    fn weighted_phase_enthalpy(liquid_enthalpy : Double, vapor_enthalpy : Double, vapor_fraction : Double) -> Double raise VleError

    weighted_rms

    fn weighted_rms(expected : Array[Double], actual : Array[Double]) -> Double raise VleError