epcsaft.equilibrium.problem#

Declare feed, phase and reaction inputs for the single native equilibrium driver.

Temperatures are K, pressure Pa, fluid amounts mol, and total energy constraints J or J/K. Pinned phase amounts are fractions of the compiled feed molar total, not absolute mol. Mapping keys are ordered into model component order; unknown species are refused. Declarations do not solve thermodynamic equations until compiled or evaluated by the native driver.

Declare native phase, reaction and solid equilibrium calculations.

Use Problem with explicit temperature (K), pressure (Pa), feed basis and phase kinds, then call solve_equilibrium with a fluid model. Solved free phase amounts use mol; pins use dimensionless feed fractions. Total enthalpy and entropy constraints use J and J/K, respectively; neutral UV uses total internal energy in J and volume in m³ with both T and P free. A returned stopping reason and equation diagnostics must be inspected before using a solution. Finite phase discovery without a descent witness is not a global stability certificate (ALG-STABILITY).

Examples

>>> from epcsaft.equilibrium import Free, Pinned
>>> Free(300.0).guess
300.0
>>> Pinned(0.0).value
0.0
class epcsaft.equilibrium.problem.Free#

Declare a free temperature, pressure or phase amount.

Variables:

guess (float or None) – Initial temperature in K or pressure in Pa when used for a free intensive. None leaves that guess absent. Phase-amount conversion refuses a non-None guess; use Free() for phase amounts.

Notes

A free phase amount is solved in mol; a Free intensive uses the unit of its enclosing Problem field. Physical admissibility is checked by the native compiler, not this dataclass.

Examples

>>> from epcsaft.equilibrium import Free
>>> Free(300.0).guess
300.0
>>> Free().guess is None
True
guess: float | None = None#
class epcsaft.equilibrium.problem.Pinned#

Pin a phase amount to a fraction of the compiled feed molar total.

Variables:

value (float) – Dimensionless fraction, admitted from zero to one for fluids. Pinned(0.0) declares an incipient fluid or an absent solid; solid declarations admit only the zero pin.

Notes

The native compiler forms the pinned molar amount as this fraction times the compiled feed total in mol. This dataclass performs no range check.

Examples

>>> from epcsaft.equilibrium import Pinned
>>> Pinned(0.25).value
0.25
value: float#
class epcsaft.equilibrium.problem.Phase#

Declare one liquid or vapor phase and its species support.

Variables:
  • name (str) – Phase identifier used by observations and returned phase order.

  • support (sequence of str or None) – Species with phase coordinates; omitted support is completed natively. Vapor completion excludes charged species. Explicit charged vapor requires DensityTemperature permittivity; an explicit empty support is refused.

  • amount (Free or Pinned) – Free amount solved in mol, or pinned fraction of compiled feed mol. Default is Free(); phase-amount guesses are not supported.

  • kind ({'liquid', 'vapor'} or None) – Required physical branch when compiled; None is refused then.

  • composition_guess (sequence or mapping) – Dimensionless mole-fraction guess in declared support’s native component order; mappings are reordered and omitted supported species get zero.

  • packing_guess (float or None) – Dimensionless initial packing fraction; None leaves it absent.

Notes

Sequences/mappings are copied at declaration. Native support, charge, branch and start admission follow ALG-EQUILIBRIUM. Declaring a branch does not establish its existence or global stability.

Examples

>>> from epcsaft.equilibrium import Phase
>>> phase = Phase('L', kind='liquid', support=['water'])
>>> phase.support
('water',)
amount: Free | Pinned#
composition_guess: collections.abc.Sequence[float] | collections.abc.Mapping[str, float] = ()#
kind: str | None = None#
name: str#
packing_guess: float | None = None#
support: collections.abc.Sequence[str] | None = None#
class epcsaft.equilibrium.problem.Discover#

Request finite native phase discovery instead of a fixed phase list.

Variables:
  • mode ({"full", "fast", "fast-tested"}) – Full searches all default starts. Fast stops at the first resolved split and attempts one two-phase declaration, without a final search. “fast-tested” then runs Full’s endpoint trial set once and only flags.

  • trials (sequence of Phase or None) – Trial phase declarations. None selects native defaults; a supplied sequence is copied and retains its support/branch choices.

  • declaration_budget (int or None) – Maximum number of declaration-solve attempts, including recovery attempts; this is not a phase-count limit. None uses native policy.

  • trial_budget (int or None) – Native limit on trial solves; None uses native policy.

Notes

Problem sets topology_declared false for discovery. Use solve_equilibrium at fixed positive T (K) and P (Pa), without solids; compile_problem requires declared phases. Free intensives and discovery with solids are refused. A finite search without a resolved descending split is not a global stability certificate; inspect diagnostics and exhausted budgets (ALG-STABILITY).

declaration_budget: int | None = None#
mode: str = 'full'#
trial_budget: int | None = None#
trials: collections.abc.Sequence[Phase] | None = None#
class epcsaft.equilibrium.problem.Feed#

Declare feed values and their physical basis before native conversion.

Variables:
  • basis (FeedKind) – Native amounts, mole fractions, mass fractions or molalities choice.

  • values (mapping of str to float) – Species values: mol for amounts; dimensionless for mole or mass fractions; mol/kg solvent for solutes on the molality basis, with relative solvent mol amounts. Missing model species map to zero. Values are not copied by this dataclass.

  • solvent_mass_kg (float or None) – Positive total solvent mass in kg for the molality basis; otherwise unused by the convenience constructors.

  • solvent (sequence of str) – Solvent identifiers for molality conversion, copied to a tuple.

Notes

Prefer the four basis-specific subclasses. Native conversion checks finite nonnegative inputs and composition sums. Fractions are admitted within the native sum tolerance, without silent renormalization.

basis: epcsaft._core.FeedKind#
solvent: collections.abc.Sequence[str] = ()#
solvent_mass_kg: float | None#
values: collections.abc.Mapping[str, float]#
class epcsaft.equilibrium.problem.MoleFractions(values: collections.abc.Mapping[str, float])#

Bases: Feed

Declare a feed by species mole fractions.

Parameters:

values (mapping of str to float) – Dimensionless species mole fractions; missing species are zero.

Notes

Native conversion uses a one-mol feed basis and requires the sum to be one within the composition tolerance; it does not renormalize. The inherited Feed attributes retain the supplied basis and values. Physical input validation occurs at native compilation.

__init__(values: collections.abc.Mapping[str, float]) → None#

Declare the feed; units and admission are documented by MoleFractions.

class epcsaft.equilibrium.problem.Amounts(values: collections.abc.Mapping[str, float])#

Bases: Feed

Declare an extensive feed in species mol.

Parameters:

values (mapping of str to float) – Nonnegative total species amounts in mol; missing species are zero.

Notes

The native feed total is the sum of the declared species mol. Reaction balances and phase amounts use this extensive basis. The inherited Feed attributes retain the supplied basis and values. Physical input validation occurs at native compilation.

Examples

>>> from epcsaft.equilibrium import Amounts
>>> Amounts({'water': 2.0}).values['water']
2.0
__init__(values: collections.abc.Mapping[str, float]) → None#

Declare the feed; units and admission are documented by Amounts.

class epcsaft.equilibrium.problem.MassFractions(values: collections.abc.Mapping[str, float])#

Bases: Feed

Declare a feed by species mass fractions.

Parameters:

values (mapping of str to float) – Dimensionless species mass fractions; missing species are zero.

Notes

Native conversion divides by component molar masses (kg/mol) on a one-kg feed basis; the resulting mol amounts are not normalized to one mol. Input mass fractions must sum to one within the composition tolerance. The inherited Feed attributes retain the supplied basis and values. Physical input validation occurs at native compilation.

__init__(values: collections.abc.Mapping[str, float]) → None#

Declare the feed; units and admission are documented by MassFractions.

class epcsaft.equilibrium.problem.Molalities(values: collections.abc.Mapping[str, float], *, solvent: collections.abc.Sequence[str], solvent_mass_kg: float)#

Bases: Feed

Declare solute molalities and a solvent mass basis.

Parameters:
  • values (mapping of str to float) – Solute molalities in mol/kg solvent; supplied solvent entries are relative solvent amounts in mol. Missing species are zero.

  • solvent (sequence of str) – Solvent identifiers for native conversion.

  • solvent_mass_kg (float) – Positive total solvent mass in kg.

Notes

Native conversion uses the solvent mass (kg) and component molar masses (kg/mol). Solute molality times total solvent kg gives solute mol; solvent amounts are rescaled to the declared solvent mass. A single omitted solvent amount is inferred from its molar mass; omitted mixed-solvent ratios are refused. The inherited Feed attributes retain the supplied basis and values. Physical input validation occurs at native compilation.

__init__(values: collections.abc.Mapping[str, float], *, solvent: collections.abc.Sequence[str], solvent_mass_kg: float) → None#

Declare the feed; units and admission are documented by Molalities.

class epcsaft.equilibrium.problem.NeutralReference(*, solvent: str, solute_molality_ratios: collections.abc.Mapping[str, float], standard_molality_mol_per_kg: float, species_reference: collections.abc.Mapping[str, epcsaft._core.SpeciesReference] | None = None)#

Declare a pure neutral solvent and a charge-neutral molality dilution path.

Variables:
  • solvent (str) – Pure neutral solvent component identifier.

  • solute_molality_ratios (mapping of str to float) – Dimensionless solute molality ratios defining the neutral dilution path, copied at construction. Native admission requires a finite positive ratio for every non-solvent model component and zero for the solvent. Omitted species map to zero, so omitting a non-solvent component is refused.

  • standard_molality_mol_per_kg (float) – Positive standard molality in mol/kg solvent.

  • species_reference (mapping of str to SpeciesReference) – Copied per-species standard choices. If nonempty, unspecified species default to infinite dilution and the solvent defaults to pure liquid.

Notes

Native reference admission checks charge neutrality, support, positive standard molality and branch realizability. This is a standard-state conversion declaration, not new fitted thermochemistry (ALG-REFERENCE).

__init__(*, solvent: str, solute_molality_ratios: collections.abc.Mapping[str, float], standard_molality_mol_per_kg: float, species_reference: collections.abc.Mapping[str, epcsaft._core.SpeciesReference] | None = None) → None#

Copy a neutral-solvent reference declaration.

Parameters:
  • solvent (str) – Identifier of the pure neutral solvent.

  • solute_molality_ratios (mapping of str to float) – Dimensionless neutral dilution-path ratios.

  • standard_molality_mol_per_kg (float) – Standard molality in mol/kg solvent.

  • species_reference (mapping of str to SpeciesReference, optional) – Explicit species standards; omitted mapping is empty.

Notes

Field meanings and native admission requirements are given by the class. Construction copies mappings without evaluating a dilution limit.

solute_molality_ratios#
solvent#
species_reference#
standard_molality_mol_per_kg#
class epcsaft.equilibrium.problem.Reaction#

Declare one stoichiometric reaction with exactly one target.

Variables:
  • stoichiometry (mapping of str to float) – Dimensionless signed coefficients: products positive, reactants negative. Missing species are zero, in model component order.

  • equilibrium_constant (float or None) – Positive dimensionless K, not ln K or log10 K; absent when using another target. Without a source reference it uses the EOS density standard.

  • name (str) – Reaction identifier for named reaction fitting; default is empty.

  • affinity_j_per_mol (float or None) – Standard reaction affinity target in J/mol of reaction as written; native standard-energy constraint equals this value (-RT ln K).

  • correlation (ReactionLogPolynomial or None) – Natural-log K(T) law; temperature in K, with its declared valid range and standard-state identifier.

  • reference (ReactionReference or None) – Explicit source basis and reference pressure in Pa for source-basis K or correlations; no implicit molality/pressure conversion is inferred.

Notes

With no K, affinity or correlation, native compilation derives targets from participating species thermochemistry. Native compilation refuses more than one supplied target (ParameterError) and checks stoichiometry, reference consistency and source applicability. The EOS activity is (rho*x_i / (1 mol/m³))*exp(mu_res_i/(RT)); K is the product of these activities raised to signed stoichiometric coefficients (ALG-EQUILIBRIUM). A fixed K alone does not supply arbitrary thermal derivatives.

Examples

>>> from epcsaft.equilibrium import Reaction
>>> reaction = Reaction({'A': -1.0, 'B': 1.0}, equilibrium_constant=2.0)
>>> reaction.equilibrium_constant
2.0
affinity_j_per_mol: float | None = None#
correlation: epcsaft._core.ReactionLogPolynomial | None = None#
equilibrium_constant: float | None = None#
name: str = ''#
reference: epcsaft._core.ReactionReference | None = None#
stoichiometry: collections.abc.Mapping[str, float]#
class epcsaft.equilibrium.problem.Solid#

Declare a pure stoichiometric solid dissolving into fluid species.

Variables:
  • name (str) – Solid identifier.

  • formula (mapping of str to float) – Dimensionless dissolution coefficients for S -> sum_i nu_i A_i; dissolved formula must be charge-neutral.

  • reference (ReactionReference) – Source constant basis with reference pressure in Pa.

  • molar_volume_m3_per_mol (float) – Positive pure-solid molar volume in m³/mol of formula units.

  • equilibrium_constant (float or None) – Positive dimensionless source dissolution K, not its logarithm; supply exactly one of this and correlation.

  • correlation (ReactionLogPolynomial or None) – Source natural-log K(T) law with temperature in K and valid interval.

  • amount (Free or Pinned) – Free solid amount solved in mol of formula units, or Pinned(0.0) for the absent-solid condition; other pins are refused natively.

Notes

Native compilation owns source-reference conversion, molar-volume pressure correction and solid complementarity. No solid-solution or kinetic model is declared here (ALG-EQUILIBRIUM, pure stoichiometric solids).

amount: Free | Pinned#
correlation: epcsaft._core.ReactionLogPolynomial | None = None#
equilibrium_constant: float | None = None#
formula: collections.abc.Mapping[str, float]#
molar_volume_m3_per_mol: float#
name: str#
reference: epcsaft._core.ReactionReference#
class epcsaft.equilibrium.problem.Problem#

Declare the physical specification for the one native equilibrium driver.

Variables:
  • phases (sequence of Phase or Discover) – Ordered fluid phases, or a finite phase-discovery request.

  • T (float or Free) – Fixed temperature in K or a free temperature declaration with K guess.

  • P (float or Free) – Fixed pressure in Pa or a free pressure declaration with Pa guess.

  • feed (Feed) – Species inventory with explicit amounts/fractions/molality basis.

  • reactions (sequence of Reaction) – Stoichiometric reaction declarations, empty for nonreacting fluids.

  • standard_gibbs_j_per_mol (sequence of float) – Species standard Gibbs energies in J/mol, in component order; empty leaves native standard-reference completion to supplied inputs.

  • topology_declared (bool or None) – Whether the phase topology is declared; None defaults true. Discover always sets this false.

  • row_tolerance (float or None) – Dimensionless tolerance for native scaled equation rows; None keeps the native policy. It is not a physical uncertainty estimate.

  • enthalpy_j (float or None) – Total extensive enthalpy constraint in J, on the compiled feed basis.

  • entropy_j_per_k (float or None) – Total extensive entropy constraint in J/K, on the compiled feed basis.

  • internal_energy_j (float or None) – Total internal energy in J; neutral nonreacting UV has both T and P free and requires volume_m3 and complete ideal records.

  • volume_m3 (float or None) – Total volume in m³ on the resolved feed basis. Neutral nonreacting TV uses fixed T, free P and declared free phases.

  • neutral_reference (NeutralReference or None) – Source standard-state conversion declaration.

  • spinodal (SpinodalDeclaration or None) – Neutral fixed-temperature null-mode solve; density nodes bound the finite search.

  • critical (CriticalDeclaration or None) – Critical-equation seed, including density in mol/m³; a solved necessary condition is not a stability certificate or unique critical point.

  • envelope (EnvelopeCondition or None) – Local envelope equation using natural-log temperature, pressure or incipient/feed mole-fraction ratio with native dimensionless references.

  • azeotrope (bool) – Request native azeotrope conditions; default false.

  • solids (sequence of Solid) – Ordered pure stoichiometric solid declarations; default empty.

Notes

The constructor copies phase/reaction/solid sequences and standard energies. Native compilation checks support, charge, conserved inventory, number and rank of equations, reference consistency and admitted caloric constraints. All root finds, equilibrium iterations and continuation are native. Returned diagnostics, not an optimizer stop alone, establish numerical closure (ALG-EQUILIBRIUM and ALG-TERMINATION).

Examples

>>> from epcsaft.equilibrium import Amounts, Phase, Problem
>>> problem = Problem(phases=[Phase('L', kind='liquid')], T=300.0,
...                   P=100000.0, feed=Amounts({'water': 1.0}))
>>> problem.T, problem.P
(300.0, 100000.0)
P: float | Free#
T: float | Free#
azeotrope: bool = False#
critical: epcsaft._core.CriticalDeclaration | None = None#
enthalpy_j: float | None = None#
entropy_j_per_k: float | None = None#
envelope: epcsaft._core.EnvelopeCondition | None = None#
feed: Feed#
internal_energy_j: float | None = None#
neutral_reference: NeutralReference | None = None#
phases: collections.abc.Sequence[Phase] | Discover = ()#
reactions: collections.abc.Sequence[Reaction] = ()#
row_tolerance: float | None = None#
solids: collections.abc.Sequence[Solid] = ()#
spinodal: epcsaft._core.SpinodalDeclaration | None = None#
standard_gibbs_j_per_mol: collections.abc.Sequence[float] = ()#
topology_declared: bool | None = True#
volume_m3: float | None = None#
epcsaft.equilibrium.problem.problem_from_mapping(mapping: collections.abc.Mapping[str, object]) → Problem#

Convert named problem fields into a Python equilibrium declaration.

Parameters:

mapping (mapping of str to object) – T in K, P in Pa, phase records, feed basis/values and optional reactions, standard Gibbs energies (J/mol), topology, row tolerance, solver options, neutral reference, total enthalpy (J) or entropy (J/K). Intensives can be scalars, {'value': ...} or free/guess mappings. Phase pins use dimensionless feed fractions.

Returns:

problem – Declaration only; no equilibrium solve has occurred.

Return type:

Problem

Raises:
  • ParameterError – Unknown top-level key, missing intensive, invalid phase amount, feed basis, record structure, reaction target or reference basis.

  • ValueError – A requested numeric mapping value cannot be converted to float.

Notes

phases='discover' or a Discover object requests discovery. This mapping reader does not accept the direct Problem fields critical, envelope, azeotrope or solids. Unknown species and physical constraints are checked when the declaration is compiled with a model.

epcsaft.equilibrium.problem.solve_equilibrium(model: _Model | IdealMoleFraction, problem: Problem | epcsaft._core.EquilibriumProblem, start: epcsaft._core.EquilibriumResult | None = None) → epcsaft._core.EquilibriumResult#

Solve a declared phase/reaction problem in the native driver.

Parameters:
  • model (Mixture or Pure) – Fluid model whose component order names every declared species.

  • problem (Problem or _core.EquilibriumProblem) – Physical specification, with T in K, P in Pa and declared feed basis.

  • start (EquilibriumResult, optional) – Prior native result supplying a start; branch/layout admission remains native and is not bypassed by a supplied result.

Returns:

result – Temperature in K, pressure in Pa, phase amounts in mol and dimensionless mole fractions in declared phase/component order, with achieved residuals, stop causes and availability diagnostics.

Return type:

EquilibriumResult

Raises:
  • ParameterError – Python species/phase mapping or native physical input admission fails.

  • DeclarationError – Native supports, structure, constraints or reference standards conflict.

Notes

Numerical nonconvergence retains native diagnostics. A fixed phase list is not a global stability certificate; discovery is a bounded native search (ALG-EQUILIBRIUM and ALG-STABILITY).

epcsaft.equilibrium.problem.compile_problem(model: _Model | IdealMoleFraction, problem: Problem | epcsaft._core.EquilibriumProblem) → epcsaft._core.CompiledSystem#

Compile a physical equilibrium declaration for reuse and exact actions.

Parameters:
  • model (Mixture or Pure) – Fluid model whose component order names every declared species.

  • problem (Problem or _core.EquilibriumProblem) – Physical specification, with T in K, P in Pa and declared feed basis.

Returns:

system – Native balances, supports, coordinates and equation rows; keeps the native model alive for solved-state derivative actions.

Return type:

CompiledSystem

Raises:
  • ParameterError – Python species/phase mapping or native physical input admission fails.

  • DeclarationError – Native supports, structure, constraints or reference standards conflict.

Notes

Numerical nonconvergence retains native diagnostics. A fixed phase list is not a global stability certificate; discovery is a bounded native search (ALG-EQUILIBRIUM and ALG-STABILITY).

epcsaft.equilibrium.problem.continue_equilibrium(model: _Model, start: Problem, target: Problem, options: Continuation, start_result: epcsaft._core.EquilibriumResult | None = None, *, parameter_targets: collections.abc.Sequence[float] | None = None) → epcsaft._core.ContinuationResult#

Continue between physical equilibrium declarations using native correctors.

Parameters:
  • model (Mixture or Pure) – Fluid model with fixed component/site order.

  • start (Problem) – Endpoint declarations. Temperature uses K, pressure Pa, feed amounts mol, and total caloric constraints J or J/K where supplied.

  • target (Problem) – Endpoint declarations. Temperature uses K, pressure Pa, feed amounts mol, and total caloric constraints J or J/K where supplied.

  • options (Continuation) – Declared path step controls, tolerances and work budgets.

  • start_result (EquilibriumResult, optional) – Previously solved starting endpoint.

  • parameter_targets (sequence of float, optional) – Target values in the model’s active-parameter order and native family units; None supplies an empty parameter-target sequence.

Returns:

result – Accepted path steps and last solved state, with reached dimensionless path coordinate, stop cause and diagnostics. Incomplete paths remain incomplete even when the last accepted point is available.

Return type:

ContinuationResult

Raises:
  • ParameterError – Species/phase mapping or physical path inputs are inadmissible.

  • DeclarationError – Endpoint supports, equations or reference declarations are incompatible.

Notes

Prediction, corrector solves, step rejection and work limits are native. Inspect success, stop and reached_path before treating a returned state as the requested endpoint (ALG-EQUILIBRIUM).

epcsaft.equilibrium.problem.asl_record(model: epcsaft.eos.Mixture, problem: Problem, continuation: epcsaft._core.ContinuationOptions, feed_offset: collections.abc.Sequence[float], feed_matrix: collections.abc.Sequence[collections.abc.Sequence[float]], anchor_controls: collections.abc.Sequence[float], identity_component: int, minimum_gap: float) → str#

Serialize the admitted two-liquid equilibrium and affine feed map for ASL.

Parameters:
  • model (Mixture) – Model whose parameters retain their source document.

  • problem (Problem) – Fixed-T/P two-free-liquid declaration with explicit supports and absolute molar feed.

  • continuation (Continuation) – Declared continuation controls for the adapter.

  • feed_offset (Sequence[float]) – Length n of absolute feed offsets in mol.

  • feed_matrix (Sequence[Sequence[float]]) – Row-major (n, k) affine coefficients mapping controls into feed mol; units are mol per caller control unit.

  • anchor_controls (Sequence[float]) – Length k of nonnegative anchor controls in the caller-declared units.

  • identity_component (int) – Component index used to preserve two-phase identity.

  • minimum_gap (float) – Positive dimensionless mole-fraction separation required for that identity.

Returns:

Native record string for the equilibrium ASL adapter.

Return type:

str

Raises:

ValueError – The parameters retain no document, or carry the stored cause a fit could not be written into it.

Notes

The map n_feed = feed_offset + feed_matrix*controls must preserve charge and reproduce the declared anchor feed. Source-reference and unsupported reaction forms are refused. Serialization is not a solve.

epcsaft.equilibrium.problem.bubble_point(*, liquid: Phase, T: float, feed: Feed, reactions: collections.abc.Sequence[Reaction] | None = None, vapor_support: collections.abc.Sequence[str] | None = None) → Problem#

Declare an isothermal bubble point with free pressure.

Parameters:
  • liquid (Phase) – Existing liquid phase declaration, retaining its support and amount.

  • T (float) – Fixed absolute temperature in K.

  • feed (Feed) – Feed declaration with explicit amounts/fractions/molality basis.

  • reactions (sequence of Reaction, optional) – Reaction declarations; None means no reactions.

  • vapor_support (sequence of str, optional) – Explicit vapor species; None keeps neutral-only completion.

Returns:

problem – Original liquid phase plus incipient vapor pinned at zero mol, with pressure free in Pa. Incipient phase name is V.

Return type:

Problem

Notes

No equilibrium calculation is performed. Native compilation/solve checks admitted phase kinds, supports, reactions and boundary existence.

epcsaft.equilibrium.problem.dew_point(*, vapor: Phase, T: float, feed: Feed, reactions: collections.abc.Sequence[Reaction] | None = None) → Problem#

Declare an isothermal dew point with free pressure.

Parameters:
  • vapor (Phase) – Existing vapor phase declaration, retaining its support and amount.

  • T (float) – Fixed absolute temperature in K.

  • feed (Feed) – Feed declaration with explicit amounts/fractions/molality basis.

  • reactions (sequence of Reaction, optional) – Reaction declarations; None means no reactions.

Returns:

problem – Original vapor phase plus incipient liquid pinned at zero mol, with pressure free in Pa. Incipient phase name is L.

Return type:

Problem

Notes

No equilibrium calculation is performed. Native compilation/solve checks admitted phase kinds, supports, reactions and boundary existence.

epcsaft.equilibrium.problem.solve_equilibrium_starts(model: _Model, problem: Problem, starts: collections.abc.Sequence[epcsaft._core.EquilibriumStart], limits: epcsaft._core.EquilibriumWorkLimits) → epcsaft._core.EquilibriumStartsResult#

Run declared starts under shared native equilibrium work limits.

Parameters:
  • model (Mixture or Pure) – Fluid model whose component order defines the inputs.

  • problem (Problem) – Physical declaration: temperature K, pressure Pa, feed on its stated basis.

  • starts (sequence of EquilibriumStart) – Ordered native starts, with temperature K, pressure Pa, physical amounts mol and dimensionless compositions/packing fractions where supplied.

  • limits (EquilibriumWorkLimits) – Attempt/iteration limits and wall-time budgets in s.

Returns:

result – Per-attempt results, causes and consumed work, with an optional selected result. Selection does not establish global stability or uniqueness.

Return type:

EquilibriumStartsResult

Raises:
  • ParameterError – Python mapping or native start/work-limit admission fails.

  • DeclarationError – The physical declaration is refused before start attempts.

Notes

The native owner enforces shared work limits and retains exhausted-budget causes rather than silently retrying without a bound (ALG-EQUILIBRIUM).

epcsaft.equilibrium.problem.tp_flash(model: _Model, *, T: float, P: float, feed: Feed) → epcsaft._core.EquilibriumResult#

Solve a declared liquid/vapor split at T (K), P (Pa), on the feed basis.

Returns the existing native result, including unavailable splits and causes. No phase discovery is performed; this is not a global stability certificate. Use Problem for reactions, solids, supports or nondefault phase guesses.

epcsaft.equilibrium.problem.critical_point(model: _Model, *, T_guess: float, P_guess: float, rho_guess: float) → epcsaft._core.EquilibriumResult#

Solve a pure critical-equation candidate with explicit K, Pa, mol/m³ guesses.

Requires a Pure model. Returns native critical diagnostics and residuals; a critical candidate is not a global stability certificate.

Re-exported names#